var startAppTest = (function () {

  var startAppTest = {};

  var MAX_SEARCH_TIME = 10000; //搜索控件时超时时间 http://doc.autoxjs.com/#/widgetsBasedAutomation?id=uiselectorfindonetimeout
  var show = console.show;
  var hide = console.hide;
  console.show = function () {
    this.showing = true;
    show.apply(console, arguments);
  };
  console.hide = function () {
    this.showing = false;
    hide.apply(console, arguments);
  };

  function bezier_curves(cp, t) {
    cx = 3.0 * (cp[1].x - cp[0].x);
    bx = 3.0 * (cp[2].x - cp[1].x) - cx;
    ax = cp[3].x - cp[0].x - cx - bx;
    cy = 3.0 * (cp[1].y - cp[0].y);
    by = 3.0 * (cp[2].y - cp[1].y) - cy;
    ay = cp[3].y - cp[0].y - cy - by;

    tSquared = t * t;
    tCubed = tSquared * t;
    result = {
      x: 0,
      y: 0,
    };
    result.x = ax * tCubed + bx * tSquared + cx * t + cp[0].x;
    result.y = ay * tCubed + by * tSquared + cy * t + cp[0].y;
    return result;
  }

  //仿真随机带曲线滑动
  //qx, qy, zx, zy, time 代表起点x,起点y,终点x,终点y,过程耗时单位毫秒
  function sml_move(qx, qy, zx, zy, time) {
    var xxy = [time];
    var point = [];
    var dx0 = {
      x: qx,
      y: qy,
    };

    var dx1 = {
      x: random(qx - 100, qx + 100),
      y: random(qy, qy + 50),
    };
    var dx2 = {
      x: random(zx - 100, zx + 100),
      y: random(zy, zy + 50),
    };
    var dx3 = {
      x: zx,
      y: zy,
    };
    point.push(dx0);
    point.push(dx1);
    point.push(dx2);
    point.push(dx3);

    for (let i = 0; i < 1; i += 0.08) {
      xxyy = [
        parseInt(bezier_curves(point, i).x),
        parseInt(bezier_curves(point, i).y),
      ];

      xxy.push(xxyy);
    }

    gesture.apply(null, xxy);
  }
  var utils$13 = {
    storage: {
      get() {},
      set() {},
    },
    clickOcrText(ocrText) {
      this.clickBounds(ocrText.bounds);
    },
    clickOcrItem(ocrItem) {
      this.clickBounds(ocrItem.bounds);
    },
    getOcrItemPoint(ocrItem) {
      var bounds = ocrItem.bounds;
      var left = bounds.left;
      var right = bounds.right;
      var top = bounds.top;
      var bottom = bounds.bottom;
      return {
        x: random(left + 1, right - 1),
        y: random(top + 1, bottom - 1),
      };
    },
    clickUIControl(UIControl) {
      //点击ui控件
      while (true) {
        if (UIControl && UIControl.clickable()) {
          UIControl.click();
          return true;
        } else if (UIControl) {
          UIControl = UIControl.parent();
        } else {
          return false;
        }
      }
    },
    clickUIText(textUI) {
      var bounds = textUI.bounds();
      this.clickBounds(bounds);
    },

    getUITextPoint(UIText) {
      return {
        x: UIText.bounds().centerX(),
        y: UIText.bounds().centerY(),
      };
    },
    existsTextStartsWith(content, ignoreLog) {
      if (textStartsWith(content).exists()) {
        var UIText = textStartsWith(content).findOne(MAX_SEARCH_TIME);
        if (!ignoreLog && UIText) {
          console.log(
            "existsTextStartsWith",
            "找到:",
            content,
            "/",
            UIText.text()
          );
        }
        return UIText;
      } else {
        return false;
      }
    },
    existsText(content, ignoreLog) {
      if (text(content).exists()) {
        var UIText = text(content).findOne(MAX_SEARCH_TIME);
        if (!ignoreLog && UIText) {
          console.log("existsText", "找到:", content, "/", UIText.text());
        }
        return UIText;
      } else {
        return false;
      }
    },
    clickText(content, ignoreLog) {
      if (this.existsText(content, true)) {
        var UIText = text(content).findOne(MAX_SEARCH_TIME);
        var bounds = UIText.bounds();
        if (!ignoreLog) {
          console.log("clickText", "找到:", content, "/", UIText.text());
        }
        this.clickBounds(bounds);
        return UIText;
      } else {
        return false;
      }
    },
    existsOneTextStartsWith(content, ignoreLog) {
      if (!Array.isArray(content)) {
        content = [content];
      }
      for (var index = 0; index < content.length; index++) {
        var item = content[index];
        var result = this.existsTextStartsWith(item, true);
        if (!ignoreLog && result) {
          console.log(
            "existsOneTextStartsWith",
            "找到:",
            item,
            "/",
            result.text()
          );
          return result;
        }
      }
    },
    clickTextStartsWith(content, ignoreLog) {
      var UIText = this.existsTextStartsWith(content, true);
      if (UIText) {
        var bounds = UIText.bounds();
        if (!ignoreLog) {
          console.log(
            "clickTextStartsWith",
            "找到:",
            content,
            "/",
            UIText.text()
          );
        }
        this.clickBounds(bounds);
        return UIText;
      } else {
        return false;
      }
    },
    existsTextEndsWith(content, ignoreLog) {
      if (textEndsWith(content).exists()) {
        var UIText = textEndsWith(content).findOne(MAX_SEARCH_TIME);
        if (!ignoreLog && UIText) {
          console.log(
            "existsTextEndsWith",
            "找到：",
            content,
            "/",
            UIText.text()
          );
        }
        return UIText;
      } else {
        return false;
      }
    },
    clickTextEndsWith(content, ignoreLog) {
      var UIText = this.existsTextEndsWith(content, true);
      if (UIText) {
        var bounds = UIText.bounds();
        if (!ignoreLog) {
          console.log("clickTextEndsWith", "找到：", content, "/", UIText.text());
        }
        this.clickBounds(bounds);
        return UIText;
      } else {
        return false;
      }
    },
    existsTextMatches(content, ignoreLog) {
      if (textMatches(content).exists()) {
        var UIText = textMatches(content).findOne(MAX_SEARCH_TIME);
        if (!ignoreLog) {
          console.log("existsTextMatches", "找到：", content, "/", UIText.text());
        }
        return UIText;
      } else {
        return false;
      }
    },
    clickTextMatches(content, ignoreLog) {
      var UIText = this.existsTextMatches(content, true);
      if (UIText) {
        if (!ignoreLog) {
          console.log("clickTextMatches", "找到：", content, "/", UIText.text());
        }
        var bounds = UIText.bounds();
        this.clickBounds(bounds);
        return UIText;
      } else {
        return false;
      }
    },
    clickBounds(bounds) {
      var left = bounds.left;
      var right = bounds.right;
      var top = bounds.top;
      var bottom = bounds.bottom;
      return this.clickXY(
        random(left + 1, right - 1),
        random(top + 1, bottom - 1)
      );
    },
    clickPoint(x1, y1, x2, y2) {
      var x = utils$13.getRandom(x1 + 1, x2 - 1);
      var y = utils$13.getRandom(y1 + 1, y2 - 1);
      this.clickXY(x, y);
      // var point = this.getCenterPoint(x1, y1, x2, y2);
      // return this.clickXY(point.x, point.y);
    },
    clickXY(x, y) {
      console.log("clickXY", x, y);
      return click(x, y);
    },
    getSizePoint(points, w, h) {
      var length = points.length;
      var sizePoints = [];
      var rateX = device.width / (w || 720);
      var rateY = device.height / (h || 1650);
      for (var i = 0; i < length; i++) {
        var point = points[i];
        var rate = i % 2 == 0 ? rateX : rateY;
        sizePoints.push(parseInt(point * rate));
      }
      return sizePoints;
    },
    getCenterPoint(x1, y1, x2, y2) {
      return {
        x: random(x1 + 1, x2 - 1),
        y: random(y1 + 1, y2 - 1),
      };
      // return {
      //   x: parseInt(x1 + (x2 - x1) / 2),
      //   y: parseInt(y1 + (y2 - y1) / 2),
      // };
    },
    getNumber(content) {
      var REGEXP = /(\d+)/g;
      var match = content.match(REGEXP);
      return parseInt(match ? match[0] : 0);
    },
    clickPointMap(pointMap) {
      var points = pointMap.points;
      var size = pointMap.size;
      this.clickPoint.apply(this, this.getSizePoint(points, size.x, size.y));
    },
    getRandom(start, end, times) {
      var times = times || 1;
      return random(start * times, end * times);
    },
    createLogger() {
      var arguments1 = [];
      var length = arguments.length;
      for (var index = 0; index < length; index++) {
        arguments1.push(arguments[index]);
      }
      return function () {
        var arguments2 = [];
        var length = arguments.length;
        for (var index = 0; index < length; index++) {
          arguments2.push(arguments[index]);
        }
        console.log.apply(console.log, arguments1.concat(arguments2));
      };
    },
    createLoggerX(prefix, count) {
      var arguments1 = [prefix];
      var execCount = 0;
      count = count || 1;
      return function () {
        var arguments2 = [];
        var length = arguments.length;
        for (var index = 0; index < length; index++) {
          arguments2.push(arguments[index]);
        }
        execCount = execCount + 1;
        if (execCount % count == 0) {
          console.log.apply(console.log, arguments1.concat(arguments2));
        }
      };
    },
    randomIndexArray(max) {
      var result = [];
      while (result.length < max) {
        var number = random(0, max - 1);
        if (result.indexOf(number) == -1) {
          result.push(number);
        }
      }
      return result;
    },
    swipe(a, b, c, d) {
      swipe(
        device.width * a * this.getRandom(95, 5, 1),
        device.height * b * this.getRandom(95, 5, 1),
        device.width * c * this.getRandom(95, 5, 1),
        device.height * d * this.getRandom(95, 5, 1),
        utils$13.getRandom(2, 8, 100)
      );
    },
    swipeX(qx, qy, zx, zy, time) {
      sml_move(qx, qy, zx, zy, time);
    },
    strFormat(str, str2) {
      if (!str) {
        return "";
      }
      str2 = str2 || "哈";
      return str.split("").join(str2);
    },
    merge(a, b, c) {
      for (var prop in c) {
        a[prop] = b[prop] || c[prop];
      }
    },
    getStorage(key) {
      return storages.create(key);
    },
  };

  var utils_1 = utils$13;

  var utils$12 = utils_1;
  var pointMap$e = {
    最近任务的关闭: [269, 1410, 451, 1592],
  };
  var appUtils$4 = {
    openApp(appName) {
      var logger = utils$12.createLogger("appUtils openApp: ");
      var result = app.launchApp(appName);
      if (!result) {
        logger("打开应用-" + appName + "-失败，可能没有安装该应用");
        return false;
      }
      logger("打开-" + appName + "-成功");
      sleep(utils$12.getRandom(200, 300, 10));
      return true;
    },
    open(packageName) {
      var logger = utils$12.createLogger("appUtils open: ");
      var result = app.launch(packageName);
      if (!result) {
        logger("打开应用-" + packageName + "-失败，可能没有安装该应用");
        return false;
      }
      logger("打开-" + packageName + "-成功");
      sleep(utils$12.getRandom(200, 300, 10));
      return true;
    },
    close() {
      var logger = utils$12.createLogger("appUtils closeX: ");
      home();
      sleep(utils$12.getRandom(200, 220, 10));
      recents();
      sleep(utils$12.getRandom(200, 220, 10));
      var deviceProduct = device.product;
      if (deviceProduct == "cannon" || deviceProduct == "evergo") {
        swipe(
          (device.width / 2 / 4) * 3,
          device.height / 2,
          device.width / 20,
          device.height / 2,
          utils$12.getRandom(2, 4, 100)
        );
      } else {
        swipe(
          device.width / 2,
          device.height / 2,
          device.width / 2,
          device.height / 20,
          utils$12.getRandom(2, 4, 100)
        );
      }
      sleep(utils$12.getRandom(200, 220, 10));
      home();
      logger("关闭-" + "最近的应用" + "-成功");
      return true;
    },
    closeAll() {
      var logger = utils$12.createLogger("appUtils close: ");
      home();
      sleep(utils$12.getRandom(200, 220, 10));
      recents();
      sleep(utils$12.getRandom(200, 220, 10));
      utils$12.clickPoint.apply(
        utils$12,
        utils$12.getSizePoint(pointMap$e["最近任务的关闭"])
      );
      logger("关闭所有应用成功");
      return true;
    },
    ifInstalled(appName) {
      return !!app.getPackageName(appName);
    },
  };
  var app_1 = appUtils$4;

  var dateRegex = /(?=(YYYY|YY|MM|DD|HH|mm|ss|ms))\1([:\/]*)/g;
  var timeSpan = {
    YYYY: ["getFullYear", 4],
    YY: ["getFullYear", 2],
    MM: ["getMonth", 2, 1], // getMonth is zero-based, thus the extra increment field
    DD: ["getDate", 2],
    HH: ["getHours", 2],
    mm: ["getMinutes", 2],
    ss: ["getSeconds", 2],
    ms: ["getMilliseconds", 3],
  };
  var time$d = {};

  time$d.str = function (str, date, utc) {
    if (typeof str !== "string") {
      date = str;
      str = "YYYY-MM-DD HH:mm:ss";
    }

    if (!date) date = new Date();
    return str.replace(dateRegex, function (match, key, rest) {
      var args = timeSpan[key];
      var name = args[0];
      var chars = args[1];
      if (utc === true) name = "getUTC" + name.slice(3);
      var val = "00" + String(date[name]() + (args[2] || 0));
      return val.slice(-chars) + (rest || "");
    });
  };

  time$d.utc = function (str, date) {
    return time$d(str, date, true);
  };

  var time_1 = time$d;

  var appUtils$3 = app_1;
  var utils$11 = utils_1;
  var defaultAppConfig = {
    interval: null, //每隔多少分钟执行一次
    lastStartTime: [], //上一次开始时间
    lastEndTime: null, //上一次结束时间
    installed: null, //是否安装
    storage: null,
    testOpenCount: null,
    actions: [],
    storage: null,
    runCount: null,
    maxRunCount: null,
  };
  function App$7(name, config) {
    this.name = name;
    utils$11.merge(this, config || {}, defaultAppConfig);
  }
  App$7.prototype.getNextAction = function () {
    for (var index = 0; index < this.actions.length; index++) {
      var action = this.actions[index];
      if (action.canFlow()) {
        return action;
      }
    }
  };
  App$7.prototype.open = function () {
    return appUtils$3.openApp(this.name);
  };
  App$7.prototype.close = function () {
    this.endTime = Date.now();
    return appUtils$3.close(this.name);
  };
  App$7.prototype.checkRunCount = function () {
    if (!this.maxRunCount) {
      return true;
    }
    this.runCount = this.storage.get("runCount") || 0;
    if (this.runCount >= this.maxRunCount) {
      console.log("已达到最大执行次数", this.name, "跳过");
      return false;
    }
    return true;
  };
  App$7.prototype.checkTestOpenCount = function () {
    if (!this.testOpenCount) {
      return true;
    }
    this.runCount = this.storage.get("runCount") || 0;
    var span = utils$11.getRandom(this.testOpenCount, this.testOpenCount + 1);
    if (this.runCount < span) {
      console.log(this.name, "runCount-", this.runCount, ",span-", span);
      this.open();
      sleep(utils$11.getRandom(6, 7.5, 1000));
      this.runTest();
      sleep(utils$11.getRandom(2, 3, 1000));
      this.close();
      this.storage.put("runCount", this.runCount + 1);
      return false;
    }
    return true;
  };
  App$7.prototype.checkInstalled = function () {
    if (this.installed === true || this.installed === false) {
      return this.installed;
    }
    var installed = appUtils$3.ifInstalled(this.name);
    this.installed = !!installed;
    if (!installed) {
      console.log("没安装", this.name, "跳过");
      return false;
    }
    return true;
  };
  App$7.prototype.checkInterval = function () {
    if (!this.interval) {
      return true;
    }
    if (!this.lastEndTime) {
      return true;
    }
    var now = Date.now();
    var wait = (
      this.interval +
      utils$11.getRandom(0, 2) -
      (now - this.lastEndTime) / 1000 / 60
    ).toFixed(2);
    if (wait > 0) {
      console.log(
        this.name,
        "checkInterval",
        "每隔-" + this.interval + "-分钟执行一次，还需等待-" + wait + "-分钟"
      );
      return false;
    }
    return true;
  };
  App$7.prototype.run = function () {
    console.log(this.name, "未定义run方法，请检查");
  };
  App$7.prototype.runTest = function () {
    console.log(this.name, "未定义runTest方法，请检查");
  };
  App$7.prototype.main = function () {
    if (!this.checkInstalled()) {
      return;
    }
    if (!this.checkRunCount()) {
      return;
    }
    if (!this.checkTestOpenCount()) {
      return;
    }
    if (!this.checkInterval()) {
      return;
    }
    this.open();
    this.lastStartTime = Date.now();
    sleep(utils$11.getRandom(6, 7.5, 1000));
    var runResult = this.run();
    if (!runResult) {
      sleep(utils$11.getRandom(2, 3, 1000));
      this.close();
    }
    this.lastEndTime = Date.now();
    this.runCount = this.storage.get("runCount") || 0;
    this.storage.put("runCount", this.runCount + 1);
  };

  var app$1 = App$7;

  var common$13 = {};

  var utils$10 = utils_1;
  var time$c = time_1;
  var pointMap$d = {
    任务: {
      points: [
        //prettier-ignore
        648, 2161, 864, 2356,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };
  function toTask$8() {
    console.log("toTask");
    utils$10.clickPointMap(pointMap$d["任务"]);
    sleep(utils$10.getRandom(1.5, 2, 1000));
    var content = "开心收下";
    var UIText = utils$10.existsTextStartsWith(content);
    if (UIText) {
      utils$10.clickUIText(UIText);
      sleep(utils$10.getRandom(1.5, 2, 1000));
    }
  }
  common$13.storage = utils$10.getStorage(time$c.str("YYYY-MM-DD") + "爆爽短剧");
  common$13.toTask = toTask$8;

  var utils$$ = utils_1;

  if (!requestScreenCapture()) {
    toastLog("请求截图权限失败");
    exit();
  }

  function toArray(arrLike) {
    var array = [];
    for (var index = 0; index < arrLike.length; index++) {
      array.push(arrLike[index]);
    }
    return array;
  }

  function getCaptureImg() {
    var startTime = Date.now();
    // console.log("getCaptureImg: 开始截图");
    var consoleShowing = console.showing;
    if (consoleShowing) {
      console.hide();
      sleep(0.1 * 1000);
    }
    var captureImg = captureScreen();
    if (consoleShowing) {
      console.show();
    }
    if (!captureImg) {
      toastLog("截图失败");
    }
    var endTime = Date.now();
    console.log("getCaptureImg: 截图耗费-" + (endTime - startTime) / 1000 + "-s");
    return captureImg;
  }

  function getCaptureImgOcrResult() {
    var captureImg = getCaptureImg();
    var captureImgOrcResults = toArray(gmlkit.ocr(captureImg, "zh").toArray(3));
    setTimeout(() => {
      captureImg.recycle();
    });
    return captureImgOrcResults;
  }

  var OCR_UTIL_CONST_CHAR_MATCH_MAP = {
    搜: ["嫂", "樓", "接", "楼"],
    赚: ["廉", "嫌", "賺", "兼"],
    看: ["着", "春"],
    文: ["女"],
    章: ["拿"],
    钱: ["线"],
    觉: ["党"],
    户: ["戶"],
    索: ["素"],
    开: ["升", "研"],
    金: ["全"],
    积: ["枳"],
    币: ["市"],
    现: ["現"],
    领: ["領", "颌"],
    读: ["渎"],
    额: ["額"],
    取: ["驭"],
    视: ["规", "初"],
    享: ["亨"],
    兑: ["兌"],
    提: ["堤"],
    体: ["休"],
    才: ["オ"],
    街: ["衔"],
    城: ["械"],
    间: ["闻"],
    来: ["來"],
    十: ["+"],
    补: ["朴"],
    贴: ["貼"],
    接: ["按"],
    倍: ["信"],
    进: ["避"],
  };

  var ocrGml$F = {
    getRegExp(content) {
      var regExpStr = content
        .split("")
        .map(function (item) {
          if (item == "D") {
            return "\\d*";
          }
          var match = OCR_UTIL_CONST_CHAR_MATCH_MAP[item];
          var piece = match
            ? "[" + match.concat(item).join("") + "]+"
            : "[" + item + "]+";
          return piece + "\\s*";
        })
        .join("");
      return {
        text: content,
        regExp: new RegExp(regExpStr, "gi"),
      };
    },
    toArray: toArray,
    captureAndLogText() {
      var captureImgOrcResults = getCaptureImgOcrResult();
      console.log(
        "captureAndLogText:",
        captureImgOrcResults.map((item) => item.text).join("\n")
      );
    },
    captureExistAll(content, logInfo) {
      var logger = utils$$.createLogger("ocrGml captureExistAll: ");
      if (!Array.isArray(content)) {
        content = [content];
      }
      var contentConfigs = content.map((item) => {
        return {
          text: content,
          regExp: this.getRegExp(item).regExp,
          find: null,
        };
      });
      // if (logInfo) {
      //   logger(
      //     "正则表达式是-" +
      //       contentConfigs.map((item) => item.regExp.toString()).join(" || ") +
      //       "-"
      //   );
      // }
      var captureImgOrcResults = getCaptureImgOcrResult();
      for (var index = 0; index < captureImgOrcResults.length; index++) {
        var item = captureImgOrcResults[index];
        for (var j = 0; j < contentConfigs.length; j++) {
          var contentConfig = contentConfigs[j];
          if (!contentConfig.find && contentConfig.regExp.test(item.text)) {
            contentConfig.find = item;
            break;
          }
        }
        if (contentConfigs.every((item) => item.find)) {
          break;
        }
      }
      if (contentConfigs.some((item) => !item.find)) {
        if (logInfo) {
          var noFinds = contentConfigs
            .filter((item) => !item.find)
            .map((item) => item.text)
            .join(" || ");
          logger("没找到-" + utils$$.strFormat(noFinds) + "-");
          this.logText(captureImgOrcResults);
        }
        return false;
      }
      return true;
    },
    captureExistOne(content, logInfo) {
      if (!Array.isArray(content)) {
        content = [content];
      }
      var configs = content.map((item) => {
        return this.getRegExp(item);
      });
      // if (logInfo) {
      //   console.log(
      //     "ocrGml captureExistOne: " +
      //       "正则表达式是：-" +
      //       configs.map((item) => item.regExp).join(" || ") +
      //       "-"
      //   );
      // }
      return this.captureMatchOne(configs, logInfo);
    },
    captureMatchOne(regExpConfigs, logInfo) {
      var captureImgOrcResults = getCaptureImgOcrResult();
      for (var index = 0; index < captureImgOrcResults.length; index++) {
        var item = captureImgOrcResults[index];
        var find = regExpConfigs.find((regExpConfig) => {
          return regExpConfig.regExp.test(item.text);
        });
        if (find && logInfo) {
          console.log(
            "captureMatchOne: 找到-",
            utils$$.strFormat(item.text + "|" + find.text) + "-"
          );
          return item;
        }
      }
      if (logInfo) {
        console.log(
          "ocrGml captureMatchOne: 没找到: ",
          utils$$.strFormat(regExpConfigs.map((item) => item.text).join(" || "))
        );
        this.logText(captureImgOrcResults);
      }
    },
    logText(captureImgOrcResults) {
      console.log(
        captureImgOrcResults
          .map(function (item) {
            return item.text;
          })
          .join("|")
      );
    },
    findTextOne(content, logInfo, ifIsEnd, maxSwipeTimes, swipeInstace) {
      if (!Array.isArray(content)) {
        content = [content];
      }
      maxSwipeTimes = maxSwipeTimes || 10;
      logInfo = logInfo || false;
      swipeInstace = swipeInstace || (device.height / 10) * 1;
      var regExpConfigs = content.map((item) => {
        return this.getRegExp(item);
      });
      var result = this.captureMatchOne(regExpConfigs, logInfo);
      if (result) {
        return result;
      }
      if (maxSwipeTimes == 1) {
        return;
      }
      maxSwipeTimes = maxSwipeTimes - 1;
      while (maxSwipeTimes > 0) {
        sleep(utils$$.getRandom(1, 1.5, 1000));
        utils$$.swipeX(
          ((device.width / 2) * utils$$.getRandom(90, 100)) / 100,
          ((device.height / 2) * utils$$.getRandom(90, 100)) / 100,
          ((device.width / 2) * utils$$.getRandom(90, 100)) / 100,
          ((device.height / 2 - swipeInstace) * utils$$.getRandom(90, 100)) / 100,
          utils$$.getRandom(500, 1000)
        );
        var result = this.captureMatchOne(regExpConfigs, logInfo);
        if (result) {
          return result;
        }
        maxSwipeTimes = maxSwipeTimes - 1;
        if (ifIsEnd && ifIsEnd()) {
          break;
        }
      }
    },
    findTextAll(content, logInfo, ifIsEnd, maxSwipeTimes, swipeInstace) {
      var logger = utils$$.createLogger("ocrGml findTextAll: ");
      if (!Array.isArray(content)) {
        content = [content];
      }
      var contentConfigs = content.map((item) => {
        return {
          text: item,
          regExp: this.getRegExp(item).regExp,
          result: null,
        };
      });
      if (logInfo) {
        logger(
          "正则表达式是： -" +
            contentConfigs.map((item) => item.regExp).join(" || ") +
            "-"
        );
      }
      maxSwipeTimes = maxSwipeTimes || 10;
      logInfo = logInfo || false;
      swipeInstace = swipeInstace || (device.height / 10) * 1;
      var ocrTextResults = [];
      while (maxSwipeTimes > 0) {
        var captureImgOrcResults = getCaptureImgOcrResult();
        for (var index = 0; index < captureImgOrcResults.length; index++) {
          var item = captureImgOrcResults[index];
          for (var j = 0; j < contentConfigs.length; j++) {
            var contentConfig = contentConfigs[j];
            var text = contentConfig.text;
            var regExp = contentConfig.regExp;
            var find = ocrTextResults.find(function (item) {
              return item.text == text;
            });
            if (!find && regExp.test(item.text)) {
              ocrTextResults.push({
                text,
                regExp,
                result: item,
              });
              logger("找到-" + utils$$.strFormat(item.text) + "-");
              break;
            }
          }
          if (ocrTextResults.length == contentConfigs.length) {
            break;
          }
        }
        if (ocrTextResults.length > 0) {
          return ocrTextResults;
        }
        if (ocrTextResults.length == 0) {
          if (logInfo) ; else {
            logger(
              "当前页面没有找到-" +
                utils$$.strFormat(
                  contentConfigs.map((item) => item.text).join(" || ")
                )
            );
          }
        }
        utils$$.swipeX(
          ((device.width / 2) * utils$$.getRandom(90, 100)) / 100,
          ((device.height / 2) * utils$$.getRandom(90, 100)) / 100,
          ((device.width / 2) * utils$$.getRandom(90, 100)) / 100,
          ((device.height / 2 - swipeInstace) * utils$$.getRandom(90, 100)) / 100,
          utils$$.getRandom(500, 1000)
        );
        sleep(utils$$.getRandom(1, 1.5, 1000));
        maxSwipeTimes = maxSwipeTimes - 1;
        if (ifIsEnd && ifIsEnd()) {
          return ocrTextResults;
        }
      }
      return ocrTextResults;
    },
  };

  var ocrGml_1 = ocrGml$F;

  var utils$_ = utils_1;
  var defaultActionConfig = {
    interval: null, //每个多少秒执行一次
    canStartHour: null, //最早可以开始的时间
    canStartHourEnd: null, //最晚可以开始的时间
    lastStartTime: null, //上一次的开始时间
    lastEndTime: null, //上一次的结束时间
    execSCount: 0, //执行成功次数
    execFCount: 0, //执行失败次数
    maxExecSCount: null, //最大成功执行次数
    maxExecFCount: null, //最大失败执行次数
    maxTotalExecCount: null, //最大总执行次数
    storage: null,
  };
  function ACTION$r(name, config) {
    this.name = name;
    utils$_.merge(this, config || {}, defaultActionConfig);
  }
  ACTION$r.prototype.getStorage = function () {
    try {
      return JSON.parse(this.storage.get(this.name));
    } catch (e) {
      return {
        lastStartTime: null,
        lastEndTime: null,
        execSCount: 0,
        execFCount: 0,
      };
    }
  };
  ACTION$r.prototype.updateStorage = function () {
    this.storage.put(
      this.name,
      JSON.stringify({
        lastStartTime: this.lastStartTime,
        lastEndTime: this.lastEndTime,
        execSCount: this.execSCount,
        execFCount: this.execFCount,
      })
    );
  };
  ACTION$r.prototype.goStart = function () {
    return true;
  };
  ACTION$r.prototype.beforeExec = function () {
    return true;
  };
  ACTION$r.prototype.exec = function () {};
  ACTION$r.prototype.afterExec = function () {};
  ACTION$r.prototype.beforeEnd = function () {};
  ACTION$r.prototype.end = function () {};
  ACTION$r.prototype.afterEnd = function () {};
  ACTION$r.prototype.canFlow = function () {
    utils$_.merge(this, this.getStorage() || {}, {
      lastStartTime: null,
      lastEndTime: null,
      execSCount: 0,
      execFCount: 0,
    });
    if (this.canStartHour) {
      var hour = new Date().getHours();
      if (hour < this.canStartHour) {
        console.log(this.name, "最早开始时间未到", hour, "/", this.canStartHour);
        return false;
      }
    }
    if (this.canStartHourEnd) {
      var hour = new Date().getHours();
      if (hour >= this.canStartHourEnd) {
        console.log(
          this.name,
          "最晚结束时间已过",
          hour,
          "/",
          this.canStartHourEnd
        );
        return false;
      }
    }
    if (this.interval && this.lastEndTime) {
      var now = Date.now();
      var hasRun = (now - this.lastEndTime) / 1000;
      if (hasRun < interval) {
        console.log(this.name, "间隔时间未到", hasRun, this.interval);
        return false;
      }
    }
    if (this.maxTotalExecCount) {
      if (this.execSCount == this.maxExecSCount) {
        console.log(this.name, "执行成功次数已达上限");
        return false;
      }
      if (this.execSCount + this.execFCount < this.maxTotalExecCount) {
        return true;
      } else {
        console.log(this.name, "总执行次数已达上限");
        return false;
      }
    }
    if (this.maxExecFCount) {
      if (this.execSCount == this.maxExecSCount) {
        console.log(this.name, "执行成功次数已达上限");
        return false;
      }
      if (this.execFCount < this.maxExecFCount) {
        return true;
      } else {
        console.log(this.name, "执行失败次数已达上限");
        return false;
      }
    }
    if (this.maxExecSCount) {
      if (this.execSCount < this.maxExecSCount) {
        return true;
      } else {
        console.log(this.name, "执行成功次数已达上限");
        return false;
      }
    }
    return true;
  };
  ACTION$r.prototype.flow = function () {
    console.show(true);
    if (!this.canFlow()) {
      sleep(utils$_.getRandom(1.5, 2, 1000));
      console.hide();
      return false;
    }
    if (this.goStart()) {
      var beforeExec = this.beforeExec();
      if (beforeExec) {
        this.exec(beforeExec);
        this.afterExec();
        this.beforeEnd();
        this.end();
        this.afterEnd();
      }
      sleep(utils$_.getRandom(1.5, 2, 1000));
      console.hide();
    } else {
      console.log(this.name, "到达开始页面失败");
      sleep(utils$_.getRandom(1.5, 2, 1000));
      console.hide();
    }
  };

  var action = ACTION$r;

  var baoShuangAd$4 = {};

  var utils$Z = utils_1;
  function swipeUp$5() {
    utils$Z.swipeX(
      ((device.width / 10) * 5 * utils$Z.getRandom(90, 100, 1)) / 100,
      ((device.height / 10) * 5 * utils$Z.getRandom(90, 100, 1)) / 100,
      ((device.width / 10) * 5 * utils$Z.getRandom(90, 100, 1)) / 100,
      ((device.height / 10) * 2 * utils$Z.getRandom(90, 100, 1)) / 100,
      utils$Z.getRandom(0.5, 1.2, 1000)
    );
  }
  var swipeUp_1 = swipeUp$5;

  var utils$Y = utils_1;
  function swipeDown$5() {
    utils$Y.swipeX(
      ((device.width / 10) * 5 * utils$Y.getRandom(90, 100, 1)) / 100,
      ((device.height / 10) * 3 * utils$Y.getRandom(90, 100, 1)) / 100,
      ((device.width / 10) * 5 * utils$Y.getRandom(90, 100, 1)) / 100,
      ((device.height / 10) * 9 * utils$Y.getRandom(90, 100, 1)) / 100,
      utils$Y.getRandom(0.5, 1.2, 1000)
    );
  }
  var swipeDown_1 = swipeDown$5;

  var utils$X = utils_1;
  var swipeUp$4 = swipeUp_1;
  var swipeDown$4 = swipeDown_1;
  function readArticle$7(span, maxUp) {
    var maxUp = maxUp || 5;
    var swipeTimes = 0;
    var startTime = Date.now();
    var count = 0;
    while (true) {
      count = count + 1;
      var randomNumber = utils$X.getRandom(0, 100);
      if (swipeTimes < maxUp) {
        if (count % 5 == 0) {
          console.log("向上滑动一次");
        }
        swipeUp$4();
      } else {
        if (randomNumber > 90) {
          if (count % 5 == 0) {
            console.log("向下滑动一次");
          }
          swipeDown$4();
        } else {
          if (count % 5 == 0) {
            console.log("向上滑动一次");
          }
          swipeUp$4();
        }
      }
      var watchContentSpan = utils$X.getRandom(1.5, 3, 1000);
      sleep(watchContentSpan);
      swipeTimes = swipeTimes + 1;
      var endTime = Date.now();
      if (count % 5 == 0) {
        console.log("已看内容-" + (endTime - startTime) / 1000 + "-s");
      }
      if (endTime - startTime >= span * 1000) {
        break;
      }
    }
  }

  var readArticle_1 = readArticle$7;

  var utils$W = utils_1;
  var ocrGml$E = ocrGml_1;
  var appUtils$2 = app_1;
  var readArticle$6 = readArticle_1;
  var pointMap$c = {
    免费领取关闭1: {
      points: [
        // prettier-ignore
        958, 173, 1035, 250,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    免费获取关闭1: {
      points: [
        // prettier-ignore
        980, 195, 1013, 228,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    奖励将于关闭1: {
      points: [
        // prettier-ignore
        964, 171, 1008, 215,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    奖励将于关闭2: {
      points: [
        // prettier-ignore
        974, 148, 998, 175,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    twoNumber关闭2: {
      points: [
        // prettier-ignore
        975, 176, 1008, 209,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    后可领取奖励关闭2: {
      points: [
        // prettier-ignore
        970, 125, 1030, 190,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };

  var ad$7 = {
    watchAd() {
      sleep(5 * 1000);
      var adType = this.getAdType();
      this.watchAdType(adType);
    },
    watchAdType(type) {
      var map = {
        1: "后可领取奖励",
        2: "跳过",
        3: "秒后得",
        4: "直播间观看时长",
        5: "立即获取",
        6: "奖励将于",
        7: "30s",
      };
      console.log("watchAdType:", type, "/", map[type]);
      if (type == 7) {
        this.watchAdType7(utils$W.getRandom(50, 50 + 3));
      }
      if (type == 6) {
        this.watchAdType6(utils$W.getRandom(50, 50 + 3));
      }
      if (type == 5) {
        this.watchAdType5(utils$W.getRandom(50, 50 + 3));
      }
      if (type == 4) {
        this.watchAdType4(utils$W.getRandom(50, 50 + 3));
      }
      if (type == 3) {
        this.watchAdType3();
      }
      if (type == 2) {
        this.watchAdType2();
      }
      if (type == 1) {
        this.watchAdType1(utils$W.getRandom(50, 50 + 3));
      }
    },
    getAdType() {
      for (var index = 0; index < 5; index++) {
        var content = /^\d{2}s$/;
        if (utils$W.existsTextMatches(content)) {
          return 7;
        }
        var content = "奖励将于";
        if (utils$W.existsTextStartsWith(content)) {
          return 6;
        }
        var content = "立即获取";
        if (utils$W.existsTextStartsWith(content)) {
          return 5;
        }
        var content = "秒后得";
        if (utils$W.existsTextEndsWith(content)) {
          return 3;
        }
        var content = "跳过";
        if (utils$W.existsTextEndsWith(content)) {
          return 2;
        }
        var content = "后可领取奖励";
        if (utils$W.existsTextEndsWith(content)) {
          return 1;
        }
        sleep(2 * 1000);
      }
    },
    type7Back(type) {
      if (type == 1) {
        appUtils$2.openApp("爆爽短剧");
        sleep(utils$W.getRandom(1.5, 2.5) * 1000);
        utils$W.clickPointMap(pointMap$c["免费领取关闭1"]);
      } else if (type == 2) ; else {
        sleep(utils$W.getRandom(1.5, 2.5) * 1000);
        utils$W.clickPointMap(pointMap$c["twoNumber关闭2"]);
      }
      sleep(utils$W.getRandom(1.5, 2.5, 1000));
      var content = "开心收下";
      var UIText = utils$W.existsTextStartsWith(content);
      if (UIText) {
        utils$W.clickUIText(UIText);
        sleep(utils$W.getRandom(1.5, 2.5, 1000));
      }
    },
    watchAdType7() {
      console.log("watchAdType5:");
      var startTime = Date.now();
      var span = utils$W.getRandom(50, 60);
      var count = 0;
      while (true) {
        sleep(utils$W.getRandom(2.5, 4) * 1000);
        var content = "应用商店";
        var UIText = utils$W.existsTextEndsWith(content);
        if (UIText) {
          this.type7Back(1);
          break;
        }
        var content = "下载次数";
        var UIText = utils$W.existsTextEndsWith(content);
        if (UIText) {
          this.type7Back(1);
          break;
        }
        var content = "跳过";
        var UIText = utils$W.clickTextEndsWith(content);
        if (UIText) {
          this.type7Back(2);
          break;
        }
        count++;
        var now = Date.now();
        var hasWatch = (now - startTime) / 1000;
        if (count % 5 == 0) {
          console.log("广告已看：" + hasWatch, "/", span);
        }
        if (hasWatch >= span) {
          console.log("最长广告时间已达，强制结束");
          console.log(currentPackage());
          this.type7Back();
          break;
        }
      }
    },
    type6Back() {
      var content = "恭喜";
      if (utils$W.existsTextStartsWith(content)) {
        utils$W.clickPointMap(pointMap$c["奖励将于关闭1"]);
        sleep(utils$W.getRandom(2.5, 8.5, 1000));
        utils$W.clickPointMap(pointMap$c["奖励将于关闭2"]);
        sleep(utils$W.getRandom(1.5, 2.5, 1000));
      } else {
        sleep(utils$W.getRandom(2.5, 8.5, 1000));
        utils$W.clickPointMap(pointMap$c["奖励将于关闭2"]);
        sleep(utils$W.getRandom(1.5, 2.5, 1000));
      }
      var content = "开心收下";
      var UIText = utils$W.existsTextStartsWith(content);
      if (UIText) {
        utils$W.clickUIText(UIText);
        sleep(utils$W.getRandom(1.5, 2.5, 1000));
      }
    },
    watchAdType6() {
      console.log("watchAdType6:");
      var startTime = Date.now();
      var span = utils$W.getRandom(50, 60);
      var count = 0;
      var hasCheck_buyongle = false;
      while (true) {
        sleep(utils$W.getRandom(1.5, 3) * 1000);
        var content = "恭喜获得";
        var UIText = utils$W.existsTextStartsWith(content);
        if (UIText) {
          this.type6Back();
          break;
        }
        var content = "不用了";
        var UIText = utils$W.existsTextEndsWith(content);
        if (UIText) {
          utils$W.clickUIText(UIText);
          hasCheck_buyongle = true;
        }
        var content = "放弃福利";
        var UIText = utils$W.existsTextEndsWith(content);
        if (UIText) {
          utils$W.clickUIText(UIText);
        }
        count++;
        var now = Date.now();
        var hasWatch = (now - startTime) / 1000;
        if (count % 5 == 0) {
          console.log("广告已看：" + hasWatch, "/", span);
        }
        if (hasWatch > 10 && !hasCheck_buyongle) {
          back();
        }
        if (hasWatch >= span) {
          console.log("最长广告时间已达，强制结束");
          console.log(currentPackage());
          this.type6Back();
          break;
        }
      }
    },
    type5Back(openApp) {
      if (openApp) {
        appUtils$2.openApp("爆爽短剧");
        sleep(utils$W.getRandom(1.5, 2.5) * 1000);
        utils$W.clickPointMap(pointMap$c["免费领取关闭1"]);
        sleep(utils$W.getRandom(1.5, 2.5, 1000));
      } else {
        sleep(utils$W.getRandom(1.5, 2.5) * 1000);
        utils$W.clickPointMap(pointMap$c["免费获取关闭1"]);
        sleep(utils$W.getRandom(1.5, 2.5, 1000));
      }
      var content = "开心收下";
      var UIText = utils$W.existsTextStartsWith(content);
      if (UIText) {
        utils$W.clickUIText(UIText);
        sleep(utils$W.getRandom(1.5, 2.5, 1000));
      }
    },
    watchAdType5() {
      console.log("watchAdType5:");
      var startTime = Date.now();
      var span = utils$W.getRandom(50, 60);
      var count = 0;
      while (true) {
        sleep(utils$W.getRandom(2.5, 4) * 1000);
        var content = "应用商店";
        var UIText = utils$W.existsTextEndsWith(content);
        if (UIText) {
          this.type5Back(true);
          break;
        }
        var content = "下载次数";
        var UIText = utils$W.existsTextEndsWith(content);
        if (UIText) {
          this.type5Back(true);
          break;
        }
        count++;
        var now = Date.now();
        var hasWatch = (now - startTime) / 1000;
        if (count % 5 == 0) {
          console.log("广告已看：" + hasWatch, "/", span);
        }
        if (hasWatch >= span) {
          console.log("最长广告时间已达，强制结束");
          console.log(currentPackage());
          this.type5Back();
          break;
        }
      }
    },
    checkBack() {
      for (var index = 0; index < 5; index++) {
        sleep(utils$W.getRandom(1.5, 2.5, 10000));
        var content = "退出";
        if (utils$W.clickTextEndsWith(content)) {
          return true;
        }
        var content = "后可领奖励";
        if (utils$W.existsTextEndsWith(content)) {
          return true;
        }
        var content = "广告";
        if (utils$W.existsTextStartsWith(content)) {
          return true;
        }
        var content = "领取成功";
        if (utils$W.existsTextStartsWith(content)) {
          return true;
        }
        back();
      }
    },
    watchAdType3() {
      var span = utils$W.getRandom(32, 35);
      readArticle$6(span, 3);
      this.back();
    },
    watchAdType2() {
      var span = utils$W.getRandom(65, 70);
      var startTime = Date.now();
      var count = 0;
      var checkActivity = false;

      while (true) {
        var hasWatch = (Date.now() - startTime) / 1000;
        if (hasWatch > span) {
          console.log("最长广告时间已达，强制结束");
          console.log(currentPackage());
          break;
        }
        sleep(5 * 1000);
        count++;
        if (count % 5 == 0) {
          console.log("广告已看：" + hasWatch, "/", span);
        }
        var content = "关闭";
        if (utils$W.clickTextEndsWith(content)) {
          this.back(true);
          return;
        }
        if (!checkActivity) {
          if (hasWatch > 15) {
            var content = ["后过期", "后结束"];
            var ocrItem = ocrGml$E.captureExistOne(content);
            if (ocrItem) {
              span = span + 30;
              checkActivity = true;
            }
          }
        }
      }
      var content = "跳过";
      if (utils$W.clickTextEndsWith(content)) {
        this.back(true);
        return;
      }
      var content = "关闭";
      if (utils$W.clickTextEndsWith(content)) {
        this.back(true);
        return;
      }
    },
    watchAdType1(span) {
      var startTime = Date.now();
      var count = 0;
      while (true) {
        var hasWatch = (Date.now() - startTime) / 1000;
        if (hasWatch > span) {
          console.log("最长广告时间已达，强制结束");
          console.log(currentPackage());
          break;
        }
        sleep(2 * 1000);
        count++;
        if (count % 5 == 0) {
          console.log("广告已看：" + hasWatch, "/", span);
        }
        var content = "跳过";
        if (
          utils$W.clickTextStartsWith(content) ||
          utils$W.clickTextEndsWith(content)
        ) {
          this.type1Back(true);
          return;
        }
      }
      this.type1Back();
    },
    type1Back(notNeedBack) {
      if (!notNeedBack) {
        utils$W.clickPointMap(pointMap$c["后可领取奖励关闭2"]);
      }
      sleep(utils$W.getRandom(2, 3, 1000));
      var content = "开心收下";
      if (utils$W.clickTextStartsWith(content)) {
        sleep(utils$W.getRandom(2.5, 3, 1000));
        return;
      }
    },
    back(notNeedBack) {
      if (!notNeedBack) {
        back();
      }
      sleep(utils$W.getRandom(2, 3, 1000));
      var content = "开心收下";
      if (utils$W.clickTextStartsWith(content)) {
        sleep(utils$W.getRandom(2.5, 3, 1000));
        return;
      }
    },
  };
  baoShuangAd$4.ad = ad$7;
  baoShuangAd$4.pointMap = pointMap$c;

  var utils$V = utils_1;
  var ACTION$q = action;
  var common$12 = common$13;
  var baoShuangAd$3 = baoShuangAd$4;

  var aTreasure$h = new ACTION$q("开宝箱", {
    storgae: common$12.storage,
  });

  aTreasure$h.exec = function () {
    var content = "开宝箱得红包";
    var UIText = utils$V.existsTextStartsWith(content);
    if (UIText) {
      utils$V.clickUIText(UIText);
      sleep(utils$V.getRandom(1.5, 2, 1000));
      var content = "立即领取";
      var UIText = utils$V.existsTextStartsWith(content);
      utils$V.clickUIText(UIText);
      sleep(utils$V.getRandom(1.5, 2, 1000));
      baoShuangAd$3.ad.watchAd();
      var content = "开心收下";
      var UIText = utils$V.existsTextStartsWith(content);
      if (UIText) {
        utils$V.clickUIText(UIText);
        sleep(utils$V.getRandom(1.5, 2, 1000));
      }
    } else {
      console.log("没找到", "开宝箱得红包");
    }
  };

  var aTreasure_1$3 = aTreasure$h;

  var utils$U = utils_1;
  var ACTION$p = action;
  var common$11 = common$13;
  var baoShuangAd$2 = baoShuangAd$4;
  var pointMap$b = {
    红包: {
      points: [
        //prettier-ignore
        813, 893, 1029, 985,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };
  var aHongBao$3 = new ACTION$p("领红包", {
    storgae: common$11.storage,
  });

  aHongBao$3.exec = function () {
    var content = "看广告赚红包";
    var UIText = utils$U.existsTextStartsWith(content);
    if (UIText) {
      var content = "今日还剩0次";
      if (utils$U.existsTextEndsWith(content)) {
        return;
      }
      utils$U.clickPointMap(pointMap$b["红包"]);
      sleep(utils$U.getRandom(1.5, 2, 1000));
      baoShuangAd$2.ad.watchAd();
      var content = "开心收下";
      var UIText = utils$U.existsTextStartsWith(content);
      if (UIText) {
        utils$U.clickUIText(UIText);
        sleep(utils$U.getRandom(1.5, 2, 1000));
      }
    }
  };

  var aHongBao_1$1 = aHongBao$3;

  var utils$T = utils_1;
  var ACTION$o = action;
  var common$10 = common$13;
  var pointMap$a = {
    我的: {
      points: [
        //prettier-ignore
        864, 2161, 1080, 2356,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    短剧推荐: {
      points: [
        //prettier-ignore
        216, 2161, 432, 2356,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    观看记录: {
      points: [
        //prettier-ignore
        465, 2161, 615, 2356,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };
  var aRandom$3 = new ACTION$o("随机行为", {
    storgae: common$10.storage,
  });
  aRandom$3.inMy = function () {
    var number = utils$T.getRandom(1, 100);
    if (number >= 20 && number < 40) {
      var content = "去提现";
      if (utils$T.clickTextStartsWith(content)) {
        sleep(utils$T.getRandom(1.5, 6, 1000));
        back();
      }
    }
    if (number >= 60 && number < 70) {
      var content = "隐私政策";
      if (utils$T.clickTextStartsWith(content)) {
        sleep(utils$T.getRandom(1.5, 6, 1000));
        back();
      }
    }
    if (number >= 90 && number < 100) {
      var content = "注销账户";
      if (utils$T.clickTextStartsWith(content)) {
        sleep(utils$T.getRandom(1.5, 6, 1000));
        back();
      }
    }
  };
  aRandom$3.exec = function () {
    var number = utils$T.getRandom(1, 100);
    if (number >= 20 && number < 40) {
      utils$T.clickPointMap(pointMap$a["我的"]);
      console.log("我的");
      sleep(utils$T.getRandom(1.5, 6, 1000));
      this.inMy();
    }
    if (number >= 60 && number < 70) {
      utils$T.clickPointMap(pointMap$a["短剧推荐"]);
      console.log("短剧推荐");
      sleep(utils$T.getRandom(1.5, 6, 1000));
    }
    if (number >= 80 && number < 100) {
      utils$T.clickPointMap(pointMap$a["观看记录"]);
      console.log("观看记录");
      sleep(utils$T.getRandom(1.5, 6, 1000));
    }
  };

  var aRandom_1$1 = aRandom$3;

  var APP$1 = app$1;
  var common$$ = common$13;
  var aTreasure$g = aTreasure_1$3;
  var aHongBao$2 = aHongBao_1$1;
  var aRandom$2 = aRandom_1$1;
  var utils$S = utils_1;
  var ocrGml$D = ocrGml_1;
  var baoShuang$1 = new APP$1("爆爽短剧", {
    interval: 10,
    maxRunCount: 30,
    storage: common$$.storage,
  });
  baoShuang$1.checkOpen = function () {
    for (var index = 0; index < 5; index++) {
      sleep(utils$S.getRandom(1.5, 3, 1000));
      var content = "开宝箱得红包";
      if (utils$S.existsTextStartsWith(content)) {
        return true;
      }
      var content = "跳过";
      if (utils$S.clickTextStartsWith(content)) {
        sleep(utils$S.getRandom(1.5, 5, 1000));
        var content = "狠心离开";
        if (utils$S.clickTextStartsWith(content)) {
          sleep(utils$S.getRandom(1.5, 5, 1000));
          return true;
        }
      }
      var content = "跳过";
      var OcrItem = ocrGml$D.captureExistOne(content, true);
      if (OcrItem) {
        utils$S.clickOcrItem(OcrItem);
        sleep(utils$S.getRandom(1.5, 5, 1000));
        var content = "狠心离开";
        var OcrItem = ocrGml$D.captureExistOne(content, true);
        if (OcrItem) {
          utils$S.clickOcrItem(OcrItem);
          sleep(utils$S.getRandom(1.5, 5, 1000));
          return true;
        }
      }
      var content = "狠心离开";
      var OcrItem = ocrGml$D.captureExistOne(content, true);
      if (OcrItem) {
        utils$S.clickOcrItem(OcrItem);
        sleep(utils$S.getRandom(1.5, 5, 1000));
        return true;
      }
    }
  };
  baoShuang$1.run = function () {
    this.checkOpen();
    aTreasure$g.flow();
    sleep(utils$S.getRandom(1.5, 3, 1000));
    aRandom$2.flow();
    sleep(utils$S.getRandom(1.5, 3, 1000));
    common$$.toTask();
    sleep(utils$S.getRandom(1.5, 3, 1000));
    aHongBao$2.flow();
    // return true;
  };

  var baoShuang_1 = baoShuang$1;

  var common$_ = {};

  var utils$R = utils_1;
  var time$b = time_1;
  var pointMap$9 = {
    任务: {
      points: [
        //prettier-ignore
        648, 2101, 864, 2296,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };
  function toTask$7() {
    console.log("toTask");
    utils$R.clickPointMap(pointMap$9["任务"]);
    sleep(utils$R.getRandom(1.5, 2, 1000));
    var content = "开心收下";
    var UIText = utils$R.existsTextStartsWith(content);
    if (UIText) {
      utils$R.clickUIText(UIText);
      sleep(utils$R.getRandom(1.5, 2, 1000));
    }
  }
  common$_.storage = utils$R.getStorage(time$b.str("YYYY-MM-DD") + "我爱追剧");
  common$_.toTask = toTask$7;

  var utils$Q = utils_1;
  var ACTION$n = action;
  var common$Z = common$_;
  var baoShuangAd$1 = baoShuangAd$4;

  var aTreasure$f = new ACTION$n("开宝箱", {
    storgae: common$Z.storage,
  });

  aTreasure$f.exec = function () {
    var content = "开宝箱得金币";
    var UIText = utils$Q.existsTextStartsWith(content);
    if (UIText) {
      utils$Q.clickUIText(UIText);
      sleep(utils$Q.getRandom(1.5, 2, 1000));
      var content = "立即领取";
      var UIText = utils$Q.existsTextStartsWith(content);
      utils$Q.clickUIText(UIText);
      sleep(utils$Q.getRandom(1.5, 2, 1000));
      baoShuangAd$1.ad.watchAd();
      var content = "开心收下";
      var UIText = utils$Q.existsTextStartsWith(content);
      if (UIText) {
        utils$Q.clickUIText(UIText);
        sleep(utils$Q.getRandom(1.5, 2, 1000));
      }
    }
  };

  var aTreasure_1$2 = aTreasure$f;

  var utils$P = utils_1;
  var ACTION$m = action;
  var common$Y = common$_;
  var baoShuangAd = baoShuangAd$4;
  var pointMap$8 = {
    红包: {
      points: [
        //prettier-ignore
        813, 893, 1029, 985,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };
  var aHongBao$1 = new ACTION$m("领红包", {
    storgae: common$Y.storage,
  });

  aHongBao$1.exec = function () {
    var content = "看广告赚红包";
    var UIText = utils$P.existsTextStartsWith(content);
    if (UIText) {
      var content = "今日还剩0次";
      if (utils$P.existsTextEndsWith(content)) {
        return;
      }
      utils$P.clickPointMap(pointMap$8["红包"]);
      sleep(utils$P.getRandom(1.5, 2, 1000));
      baoShuangAd.ad.watchAd();
      var content = "开心收下";
      var UIText = utils$P.existsTextStartsWith(content);
      if (UIText) {
        utils$P.clickUIText(UIText);
        sleep(utils$P.getRandom(1.5, 2, 1000));
      }
    }
  };

  var aHongBao_1 = aHongBao$1;

  var utils$O = utils_1;
  var ACTION$l = action;
  var common$X = common$_;
  var pointMap$7 = {
    我的: {
      points: [
        //prettier-ignore
        864, 2101, 1080, 2296,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    短剧推荐: {
      points: [
        //prettier-ignore
        216, 2101, 432, 2296,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    观看记录: {
      points: [
        //prettier-ignore
        432, 2101, 648, 2296,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };
  var aRandom$1 = new ACTION$l("随机行为", {
    storgae: common$X.storage,
  });
  aRandom$1.inMy = function (number) {
    var number = number || utils$O.getRandom(1, 100);
    if (number >= 20 && number < 30) {
      var content = "当前金币";
      if (utils$O.clickTextStartsWith(content)) {
        sleep(utils$O.getRandom(1.5, 6, 1000));
        back();
      }
    }
    if (number >= 30 && number < 40) {
      var content = "余额";
      if (utils$O.clickTextStartsWith(content)) {
        sleep(utils$O.getRandom(1.5, 6, 1000));
        back();
      }
    }
    if (number >= 60 && number < 70) {
      var content = "清除缓存";
      if (utils$O.clickTextStartsWith(content)) {
        sleep(utils$O.getRandom(1.5, 6, 1000));
        back();
      }
    }
    if (number >= 90 && number < 100) {
      var content = "个性化推送";
      if (utils$O.clickTextStartsWith(content)) {
        sleep(utils$O.getRandom(1.5, 6, 1000));
        back();
      }
    }
  };
  aRandom$1.exec = function () {
    var number = utils$O.getRandom(1, 100);
    if (number >= 20 && number < 40) {
      utils$O.clickPointMap(pointMap$7["我的"]);
      console.log("我的");
      sleep(utils$O.getRandom(1.5, 6, 1000));
      this.inMy();
    }
    if (number >= 60 && number < 70) {
      utils$O.clickPointMap(pointMap$7["短剧推荐"]);
      console.log("短剧推荐");
      sleep(utils$O.getRandom(1.5, 6, 1000));
    }
    if (number >= 80 && number < 100) {
      utils$O.clickPointMap(pointMap$7["观看记录"]);
      console.log("观看记录");
      sleep(utils$O.getRandom(1.5, 6, 1000));
    }
  };

  var aRandom_1 = aRandom$1;

  var APP = app$1;
  var common$W = common$_;
  var aTreasure$e = aTreasure_1$2;
  var aHongBao = aHongBao_1;
  var aRandom = aRandom_1;
  var utils$N = utils_1;
  var ocrGml$C = ocrGml_1;
  var woAiZhuiJu$1 = new APP("我爱追剧", {
    interval: 10,
    maxRunCount: 30,
    storage: common$W.storage,
  });
  woAiZhuiJu$1.checkOpen = function () {
    for (var index = 0; index < 5; index++) {
      sleep(utils$N.getRandom(1.5, 3, 1000));
      var content = "开宝箱得金币";
      if (utils$N.existsTextStartsWith(content)) {
        return true;
      }
      var content = "跳过";
      if (utils$N.clickTextStartsWith(content)) {
        sleep(utils$N.getRandom(1.5, 5, 1000));
        var content = "狠心离开";
        if (utils$N.clickTextStartsWith(content)) {
          sleep(utils$N.getRandom(1.5, 5, 1000));
          return true;
        }
      }
      var content = "跳过";
      var OcrItem = ocrGml$C.captureExistOne(content, true);
      if (OcrItem) {
        utils$N.clickOcrItem(OcrItem);
        sleep(utils$N.getRandom(1.5, 5, 1000));
        var content = "狠心离开";
        var OcrItem = ocrGml$C.captureExistOne(content, true);
        if (OcrItem) {
          utils$N.clickOcrItem(OcrItem);
          sleep(utils$N.getRandom(1.5, 5, 1000));
          return true;
        }
      }
      var content = "狠心离开";
      var OcrItem = ocrGml$C.captureExistOne(content, true);
      if (OcrItem) {
        utils$N.clickOcrItem(OcrItem);
        sleep(utils$N.getRandom(1.5, 5, 1000));
        return true;
      }
    }
  };
  woAiZhuiJu$1.run = function () {
    this.checkOpen();
    aTreasure$e.flow();
    sleep(utils$N.getRandom(1.5, 3, 1000));
    aRandom.flow();
    sleep(utils$N.getRandom(1.5, 3, 1000));
    common$W.toTask();
    sleep(utils$N.getRandom(1.5, 3, 1000));
    aHongBao.flow();
    // return true;
  };

  var woAiZhuiJu_1 = woAiZhuiJu$1;

  var common$V = {};

  var utils$M = utils_1;
  var ocrGml$B = ocrGml_1;
  var readArticle$5 = readArticle_1;

  var ad$6 = {
    isOver: function () {
      return utils$M.existsTextStartsWith("领取成功");
    },
    watchAd() {
      sleep(5 * 1000);
      var adType = this.getAdType();
      this.watchAdType(adType);
    },
    getAdType() {
      for (var index = 0; index < 5; index++) {
        var content = "直播间观看时长";
        if (utils$M.existsTextStartsWith(content)) {
          return 4;
        }
        var content = "秒后得";
        if (utils$M.existsTextEndsWith(content)) {
          return 3;
        }
        var content = "跳过";
        if (utils$M.existsTextEndsWith(content)) {
          return 2;
        }
        var content = "后可领奖励";
        if (utils$M.existsTextEndsWith(content)) {
          return 1;
        }
        sleep(2 * 1000);
      }
    },
    watchAdType(type) {
      var map = {
        1: "后可领奖励",
        2: "跳过",
        3: "秒后得",
        4: "直播间观看时长",
      };
      console.log("watchAdType:", type, "/", map[type]);
      if (type == 4) {
        this.watchAdType4(utils$M.getRandom(50, 50 + 3));
      }
      if (type == 3) {
        this.watchAdType3();
      }
      if (type == 2) {
        this.watchAdType2();
      }
      if (type == 1) {
        this.watchAdType1(utils$M.getRandom(50, 50 + 3));
      }
    },
    watchAdType4(span) {
      var startTime = Date.now();
      var count = 0;
      while (true) {
        var hasWatch = (Date.now() - startTime) / 1000;
        if (hasWatch > span) {
          console.log("最长广告时间已达，强制结束");
          break;
        }
        sleep(2 * 1000);
        count++;
        if (count % 5 == 0) {
          console.log("广告已看：" + hasWatch, "/", span);
        }
        if (hasWatch >= 10) {
          if (utils$M.clickTextStartsWith("取消")) {
            sleep(utils$M.getRandom(1.5, 2.5) * 1000);
          }
        }
        if (this.isOver()) {
          var interval = utils$M.getRandom(2, 4);
          console.log("广告已结束,再过-", interval, "-后关闭");
          sleep(interval * 1000);
          break;
        }
      }
      this.checkBack();
      this.back();
    },
    checkBack() {
      for (var index = 0; index < 5; index++) {
        sleep(utils$M.getRandom(1.5, 2.5, 10000));
        var content = "退出";
        if (utils$M.clickTextEndsWith(content)) {
          return true;
        }
        var content = "后可领奖励";
        if (utils$M.existsTextEndsWith(content)) {
          return true;
        }
        var content = "广告";
        if (utils$M.existsTextStartsWith(content)) {
          return true;
        }
        var content = "领取成功";
        if (utils$M.existsTextStartsWith(content)) {
          return true;
        }
        back();
      }
    },
    watchAdType3() {
      var span = utils$M.getRandom(32, 35);
      readArticle$5(span, 3);
      this.back();
    },
    watchAdType2() {
      var span = utils$M.getRandom(65, 70);
      var startTime = Date.now();
      var count = 0;
      var checkActivity = false;

      while (true) {
        var hasWatch = (Date.now() - startTime) / 1000;
        if (hasWatch > span) {
          console.log("最长广告时间已达，强制结束");
          break;
        }
        sleep(5 * 1000);
        count++;
        if (count % 5 == 0) {
          console.log("广告已看：" + hasWatch, "/", span);
        }
        var content = "关闭";
        if (utils$M.clickTextEndsWith(content)) {
          this.back(true);
          return;
        }
        if (!checkActivity) {
          if (hasWatch > 15) {
            var content = ["后过期", "后结束"];
            var ocrItem = ocrGml$B.captureExistOne(content);
            if (ocrItem) {
              span = span + 30;
              checkActivity = true;
            }
          }
        }
      }
      var content = "跳过";
      if (utils$M.clickTextEndsWith(content)) {
        this.back(true);
        return;
      }
      var content = "关闭";
      if (utils$M.clickTextEndsWith(content)) {
        this.back(true);
        return;
      }
    },
    watchAdType1(span) {
      var startTime = Date.now();
      var count = 0;
      while (true) {
        var hasWatch = (Date.now() - startTime) / 1000;
        if (hasWatch > span) {
          console.log("最长广告时间已达，强制结束");
          break;
        }
        sleep(2 * 1000);
        count++;
        if (count % 5 == 0) {
          console.log("广告已看：" + hasWatch, "/", span);
        }
        if (hasWatch >= 20) {
          if (!utils$M.existsTextStartsWith("广告")) {
            back();
            sleep(utils$M.getRandom(1.5, 2.5) * 1000);
          }
        }
        if (this.isOver()) {
          var interval = utils$M.getRandom(2, 4);
          console.log("广告已结束,再过-", interval, "-后关闭");
          sleep(interval * 1000);
          if (!utils$M.existsTextStartsWith("广告")) {
            back();
            sleep(utils$M.getRandom(1.5, 2.5) * 1000);
          }
          break;
        }
      }
      this.back();
    },
    back(notNeedBack) {
      if (!notNeedBack) {
        back();
      }
      sleep(utils$M.getRandom(2, 3, 1000));
      var content = "领取奖励";
      if (utils$M.clickTextStartsWith(content)) {
        sleep(utils$M.getRandom(2.5, 3, 1000));
        this.watchAd();
        return;
      }
      // var content = "坚持退出";
      // if (utils.clickTextStartsWith(content)) {
      //   sleep(utils.getRandom(2.5, 3, 1000));
      // }
      var content = "再看一个获取";
      if (utils$M.clickTextStartsWith(content)) {
        sleep(utils$M.getRandom(2.5, 3, 1000));
        this.watchAd();
        return;
      }
      // var content = "坚持退出";
      // if (utils.clickTextStartsWith(content)) {
      //   sleep(utils.getRandom(2.5, 3, 1000));
      // }
      var content = "再看一个继续";
      if (utils$M.clickTextStartsWith(content)) {
        sleep(utils$M.getRandom(2.5, 3, 1000));
        this.watchAd();
        return;
      }
      // var content = "直接退出";
      // if (utils.clickTextStartsWith(content)) {
      //   sleep(utils.getRandom(2.5, 3, 1000));
      // }
    },
  };
  var fanQieAd = ad$6;

  var utils$L = utils_1;
  var ocrGml$A = ocrGml_1;
  var time$a = time_1;
  var ad$5 = fanQieAd;
  var pointMap$6 = {
    我的: {
      points: [
        // prettier-ignore
        576, 1522, 720, 1618,
      ],
      size: {
        x: 720,
        y: 1650,
      },
    },
    去赚钱: {
      points: [
        // prettier-ignore
        24, 541, 696, 785,
      ],
      size: {
        x: 720,
        y: 1650,
      },
    },
  };
  function inHome$6() {
    // prettier-ignore
    var contents = [
            "首页",
            "我的"
        ];
    var result = ocrGml$A.captureExistAll(contents, true);
    return result;
  }
  function toTask$6() {
    console.log("前往-首页任务-");
    utils$L.clickPointMap(pointMap$6["我的"]);
    sleep(utils$L.getRandom(2.5, 4.5, 1000));
    utils$L.clickPointMap(pointMap$6["去赚钱"]);
  }
  var storage$6 = utils$L.getStorage(time$a.str("YYYY-MM-dd") + "西瓜");

  common$V.pointMap = pointMap$6;
  common$V.inHome = inHome$6;
  common$V.toTask = toTask$6;
  common$V.storage = storage$6;
  common$V.ad = ad$5;

  var ACTION$k = action;
  var common$U = common$V;
  var utils$K = utils_1;
  var ocrGml$z = ocrGml_1;
  var aTreasure$d = new ACTION$k("开宝箱", {
    storage: common$U.storage,
  });

  aTreasure$d.start = function () {
    var content = "点击领金币";
    var UIText = utils$K.existsTextStartsWith(content);
    if (UIText) {
      utils$K.clickUIText(UIText);
      sleep(utils$K.getRandom(2.5, 4.5, 1000));
      return true;
    }
    var OcrItem = ocrGml$z.captureExistOne(content, true);
    if (OcrItem) {
      utils$K.clickOcrItem(OcrItem);
      sleep(utils$K.getRandom(2.5, 4.5, 1000));
      return true;
    }
    return false;
  };
  aTreasure$d.watchAd = function () {
    sleep(utils$K.getRandom(2.5, 4.5, 1000));
    common$U.ad.watchAd();
    var content = "开心收下";
    var UIText = utils$K.existsTextStartsWith(content);
    if (UIText) {
      utils$K.clickUIText(UIText);
      var waitSpan = utils$K.getRandom(2.5, 3, 1000);
      console.log("广告看完，再等待-" + waitSpan / 1000 + "-后继续");
      sleep(waitSpan);
      return;
    }
    var OcrItem = ocrGml$z.captureExistOne(content);
    if (OcrItem) {
      utils$K.clickOcrItem(OcrItem);
      var waitSpan = utils$K.getRandom(2.5, 3, 1000);
      console.log("广告看完，再等待-" + waitSpan / 1000 + "-后继续");
      sleep(waitSpan);
      return;
    }
  };
  aTreasure$d.exec = function () {
    var execCount = 0;
    while (this.start()) {
      execCount++;
      if (execCount == 20) {
        console.log("aTreasure.exec 执行次数超过限制");
      }
      var content = "看广告视频再得";
      var UIText = utils$K.existsTextStartsWith(content);
      if (UIText) {
        utils$K.clickUIText(UIText);
        this.watchAd();
        continue;
      }
      var OcrItem = ocrGml$z.captureExistOne(content, true);
      if (OcrItem) {
        utils$K.clickOcrItem(OcrItem);
        this.watchAd();
        continue;
      }
    }
  };
  var aTreasure_1$1 = aTreasure$d;

  var ACTION$j = action;
  var common$T = common$V;
  var utils$J = utils_1;
  var ocrGml$y = ocrGml_1;
  var aAward = new ACTION$j("可领取", {
    storage: common$T.storage,
  });

  aAward.start = function () {
    var content = "可领取";
    var UIText = utils$J.existsTextStartsWith(content, true);
    if (UIText) {
      utils$J.clickUIText(UIText);
      sleep(utils$J.getRandom(2.5, 4.5, 1000));
      return true;
    }
    var OcrItem = ocrGml$y.captureExistOne(content);
    if (OcrItem) {
      utils$J.clickOcrItem(OcrItem);
      sleep(utils$J.getRandom(2.5, 4.5, 1000));
      return true;
    }
    return false;
  };
  aAward.watchAd = function () {
    sleep(utils$J.getRandom(2.5, 4.5, 1000));
    common$T.ad.watchAd();
    var content = "开心收下";
    var UIText = utils$J.existsTextStartsWith(content);
    if (UIText) {
      utils$J.clickUIText(UIText);
      var waitSpan = utils$J.getRandom(2.5, 3, 1000);
      console.log("广告看完，再等待-" + waitSpan / 1000 + "-后继续");
      sleep(waitSpan);
      return;
    }
    var OcrItem = ocrGml$y.captureExistOne(content);
    if (OcrItem) {
      utils$J.clickOcrItem(OcrItem);
      var waitSpan = utils$J.getRandom(2.5, 3, 1000);
      console.log("广告看完，再等待-" + waitSpan / 1000 + "-后继续");
      sleep(waitSpan);
      return;
    }
  };
  aAward.exec = function () {
    var execCount = 0;
    if (this.start()) {
      execCount++;
      if (execCount == 20) {
        console.log("aAward.exec 执行次数超过限制");
      }
      var content = "看广告视频再";
      var UIText = utils$J.existsTextStartsWith(content);
      if (UIText) {
        utils$J.clickUIText(UIText);
        this.watchAd();
        return;
      }
      var OcrItem = ocrGml$y.captureExistOne(content, true);
      if (OcrItem) {
        utils$J.clickOcrItem(OcrItem);
        this.watchAd();
        return;
      }
    }
  };
  var aAward2$1 = aAward;

  var App$6 = app$1;
  var utils$I = utils_1;
  var common$S = common$V;
  var aTreasure$c = aTreasure_1$1;
  var aAward2 = aAward2$1;
  var xiGua = new App$6("西瓜视频", {
    interval: 10,
    storage: common$S.storage,
  });

  xiGua.actions = [aTreasure$c];
  xiGua.runTest = function () {
    common$S.toTask();
    sleep(utils$I.getRandom(5, 7, 1000));
  };
  xiGua.run = function () {
    if (common$S.inHome()) {
      sleep(utils$I.getRandom(1.5, 2, 1000));
      common$S.toTask();
      sleep(utils$I.getRandom(5, 12, 1000));
      aAward2.flow();
      sleep(utils$I.getRandom(2, 3, 1000));
      aTreasure$c.flow();
    }
  };

  var common$R = {};

  var time$9 = time_1;
  var utils$H = utils_1;
  var ocrGml$x = ocrGml_1;
  var pointMap$5 = {
    首页任务: {
      points: [
        // prettier-ignore
        432, 2235, 648, 2356,
      ],
      size: {
        x: 1080,
        y: 2400,
      },
    },
  };

  function inHome$5() {
    // prettier-ignore
    var contents = [
          "视频",
          "我的"
      ];
    var result = ocrGml$x.captureExistAll(contents, true);
    return result;
  }

  function toTask$5() {
    console.log("前往-首页任务-");
    utils$H.clickPointMap(pointMap$5["首页任务"]);
  }

  function ifHasNextAdDefault$4() {
    var contents = [
      //prettier-ignore
      "看视频领",
      "看视频再领",
      "看视频再得",
      "看广告领",
      "看广告再领",
      "看广告再得",
    ];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      var UIText = utils$H.existsTextStartsWith(content);
      if (UIText) {
        console.log("找到-" + content + "-", ",存在下一个广告可看");
        return {
          result: true,
          trigger: function () {
            utils$H.clickUIText(UIText);
          },
        };
      }
    }
    return {
      result: false,
      trigger: function () {},
    };
  }
  function ifAdOverDefault$4() {
    var UIText = utils$H.existsTextStartsWith("领取成功");
    if (UIText) {
      console.log("找到-领取成功-");
    }
    return UIText;
  }
  function existAdDefault$4() {
    var contents = [
      //prettier-ignore
      "残忍离开",
      "坚持离开",
      "残忍退出",
      "坚持退出",
    ];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      var UIText = utils$H.existsTextStartsWith(content);
      if (UIText) {
        console.log("找到-" + content + "-，", "关闭广告");
        utils$H.clickUIText(UIText);
      }
    }
  }

  var AD_CONST_MIN_INTERVAL$4 = 40;
  var AD_CONST_MAX_GO_BACK_TIMES$4 = 4;

  var ad$4 = {
    inStart: false,
    inHome: false,
    ifHasNextAd: null, //判断是否有下一个广告
    ifAdOver: null, //判断广告实际是否比预计时间提前结束
    ifInStart: null, //判断是否是在任务页
    ifInHome: null, //判断是否在首页
    hasWatchTimes: 0,
    maxTimes: 0,
    init(maxTimes, ifInStart, ifHasNextAd, ifAdOver, exitAd, ifInHome) {
      this.hasWatchTimes = 0;
      this.maxTimes = utils$H.getRandom(maxTimes, maxTimes + 2);
      this.ifInStart = ifInStart;
      this.ifHasNextAd = ifHasNextAd || ifHasNextAdDefault$4;
      this.ifAdOver = ifAdOver || ifAdOverDefault$4;
      this.exitAd = exitAd || existAdDefault$4;
      this.ifInHome = ifInHome || inHome$5;
      console.log("ad init: 本轮最多看-" + this.maxTimes + "-个广告");
      this.run();
    },
    run() {
      //开始看广告
      var adSpan = AD_CONST_MIN_INTERVAL$4 + utils$H.getRandom(0, 5);
      console.log(
        //prettier-ignore
        "ad run: 开始看-" + (this.hasWatchTimes+1) + "-个广告，预计时间-" + adSpan + "-s"
      );
      var checkAdOverSpan = 2; //每隔2s检查当前广告是否已经结束
      var isOverEarly = false;
      var hasWatchSpan = 0;
      var count = 0;
      while (adSpan > checkAdOverSpan) {
        if (hasWatchSpan > 30) {
          if (!utils$H.existsTextStartsWith("广告")) {
            console.log(
              //prettier-ignore
              "ad run: 已过-" + hasWatchSpan + "-s但是没找到-广告-,即将执行一次back()"
            );
            back();
            sleep(utils$H.getRandom(2, 2.5, 1000));
          }
        }
        if (this.ifAdOver && this.ifAdOver()) {
          var waitSpan = utils$H.getRandom(2, 3.5);
          console.log("ad run: 广告已结束,再过" + waitSpan + "s后停止当前广告");
          sleep(waitSpan * 1000);
          isOverEarly = true; //广告实际比预计的时间提前结束
          break;
        }
        sleep(checkAdOverSpan * 1000);
        adSpan = adSpan - checkAdOverSpan;
        hasWatchSpan = hasWatchSpan + checkAdOverSpan;
        count = count + 1;
        if (count % 5 == 0) {
          console.log("ad run: 广告时间预计还剩-" + adSpan + "-s");
        }
      }
      this.hasWatchTimes = this.hasWatchTimes + 1;
      if (isOverEarly) {
        this.goBack();
        return;
      }
      if (adSpan > 0) {
        console.log("ad run: 广告时间还剩最后的" + adSpan + "秒");
        sleep(adSpan * 1000);
        this.goBack();
        return;
      }
    },
    goBack() {
      var index = 0;
      while (index < AD_CONST_MAX_GO_BACK_TIMES$4) {
        console.log("ad goBack: 第" + (index + 1) + "次执行back");
        back();
        sleep(utils$H.getRandom(2.5, 4, 1000));
        var hasNextAd = this.ifHasNextAd();
        if (hasNextAd.result) {
          if (this.hasWatchTimes >= this.maxTimes) {
            console.log(
              //prettier-ignore
              "当前看广告-" + this.hasWatchTimes + "-次，最多看-" + this.maxTimes + "-次，执行exitAd"
            );
            this.exitAd();
            return;
          } else {
            console.log("开始看下一个广告");
            hasNextAd.trigger();
            sleep(utils$H.getRandom(2, 3, 1000));
            this.run();
            return;
          }
        }
        if (this.ifInStart && this.ifInStart()) {
          console.log("ad goBack: 判断在开始页");
          this.inStart = true;
          this.after();
          return;
        }
        if (this.ifInHome && this.ifInHome()) {
          console.log("ad goBack: 判断在app首页");
          this.inHome = true;
          this.after();
          return;
        }
        index = index + 1;
      }
      this.after();
    },
    after() {
      console.log("ad after");
      this.next();
    },
    next() {
      console.log("ad next");
    },
  };

  var storage$5 = utils$H.getStorage(time$9.str("YYYY-MM-DD") + "今日头条");
  common$R.inHome = inHome$5;
  common$R.toTask = toTask$5;
  common$R.ad = ad$4;
  common$R.storage = storage$5;

  var ocrGml$w = ocrGml_1;
  var utils$G = utils_1;
  var common$Q = common$R;

  var inTask$k = {
    run(config) {
      if (this.over()) {
        return;
      }
      this.sign();
      if (config && config.fromAd) ; else {
        this.ad();
      }
      if (config && config.fromAward) ; else {
        this.award();
      }
    },
    //点击领取
    award() {
      var contents = ["点击领取"];
      var ocrItem = ocrGml$w.captureExistOne(contents, true);
      if (ocrItem) {
        utils$G.clickOcrItem(ocrItem);
        sleep(utils$G.getRandom(2, 3, 1000));
        this.run({ fromAward: true });
      }
    },
    over() {
      var contents = ["开心收下", "立即收下"];
      var ocrItem = ocrGml$w.captureExistOne(contents, true);
      if (ocrItem) {
        utils$G.clickOcrItem(ocrItem);
        sleep(utils$G.getRandom(2, 3, 1000));
        return true;
      }
    },
    sign() {
      var contents = ["立即签到"];
      var ocrItem = ocrGml$w.captureExistOne(contents, true);
      if (ocrItem) {
        utils$G.clickOcrItem(ocrItem);
        sleep(utils$G.getRandom(2, 3, 1000));
        this.run();
      }
    },
    ad() {
      var contents = ["看广告再", "看视频再", "看广告领", "看视频领"];
      var ocrItem = ocrGml$w.captureExistOne(contents, true);
      if (ocrItem) {
        utils$G.clickOcrItem(ocrItem);
        sleep(utils$G.getRandom(2, 3, 1000));
        common$Q.ad.init(1, function () {
          var ocrItem = ocrGml$w.captureExistOne([
            "任务中心",
            "现金收益",
            "展示在首页",
          ]);
          return ocrItem;
        });
        sleep(utils$G.getRandom(2, 3, 1000));
        this.run({
          fromAd: true,
        });
      }
    },
  };

  var inTask_1$4 = inTask$k;

  var ACTION$i = action;
  var utils$F = utils_1;
  var ocrGml$v = ocrGml_1;
  var actionRead$4 = new ACTION$i("阅读");
  var readArticle$4 = readArticle_1;
  actionRead$4.startRead = function () {
    var content = ["小时前", "天前", "周前", "前天", "月前"];
    var ocrItem = ocrGml$v.findTextOne(
      content,
      true,
      null,
      5,
      (device.height / 10) * 2
    );
    if (ocrItem) {
      console.log("找到-" + ocrItem.text + "-");
      utils$F.clickOcrItem(ocrItem);
      sleep(utils$F.getRandom(3, 5, 1000));
      var ocrItem = ocrGml$v.captureExistOne(["全屏"], true);
      if (ocrItem) {
        var baseSpan = 10;
        var span = utils$F.getRandom(baseSpan, baseSpan + 30);
        console.log("开始看视频-" + span + "-s");
        sleep(span * 1000);
        back();
        sleep(utils$F.getRandom(2, 4, 1000));
        return;
      }
      var baseSpan = 40;
      var span = utils$F.getRandom(baseSpan, baseSpan + 5);
      console.log("开始看文章-" + span + "-s");
      readArticle$4(span);
      back();
      sleep(utils$F.getRandom(2, 4, 1000));
      return;
    }
  };

  actionRead$4.exec = function () {
    this.startRead();
  };

  var aRead$b = actionRead$4;

  var ACTION$h = action;
  var utils$E = utils_1;
  var time$8 = time_1;
  var ocrGml$u = ocrGml_1;

  function getActionEat$c(config, ad, contentType) {
    var actionEat = new ACTION$h(contentType, config);

    actionEat.goStart = function () {
      var ocrItem = ocrGml$u.captureExistOne("吃饭补贴", true);
      if (ocrItem) {
        this.execFCount++;
        this.updateStorage();
        utils$E.clickOcrItem(ocrItem);
        sleep(utils$E.getRandom(2.5, 3, 1000));
      }
      return ocrItem;
    };

    actionEat.beforeExec = function () {
      var content = "领取" + contentType + "补贴";
      if (utils$E.clickTextStartsWith(content)) {
        this.execSCount++;
        this.updateStorage();
        return true;
      }
      var content = "直接领取";
      var UIText = utils$E.existsTextStartsWith(content);
      if (UIText) {
        utils$E.clickUIText(UIText);
        this.execSCount++;
        this.updateStorage();
        return true;
      }
      var content = "再过";
      var UIText = utils$E.existsTextStartsWith(content);
      if (UIText) {
        this.execSCount++;
        this.updateStorage();
        this.afterExec();
      }
      return false;
    };
    actionEat.exec = function () {
      sleep(utils$E.getRandom(2, 3, 1000));
      var contents = [
        //prettier-ignore
        "看视频再",
        "看广告再",
      ];
      var UIText = utils$E.existsOneTextStartsWith(contents);
      if (UIText) {
        utils$E.clickUIText(UIText);
        sleep(utils$E.getRandom(2, 3, 1000));
        var contents = ["开心收下", "立即收下"];
        var ocrItem = ocrGml$u.captureExistOne(contents, true);
        if (ocrItem) {
          utils$E.clickOcrItem(ocrItem);
          sleep(utils$E.getRandom(2, 3, 1000));
          return;
        }
        ad.init(1, function () {
          var ocrItem = ocrGml$u.captureExistOne([
            "时间到啦",
            "开饭时间",
            "每餐可获得",
          ]);
          return ocrItem;
        });
        return;
      }
      var contents = [
        //prettier-ignore
        "开心收下",
        "立即收下",
      ];
      var UIText = utils$E.existsOneTextStartsWith(contents);
      if (UIText) {
        utils$E.clickUIText(UIText);
        return;
      }
    };
    actionEat.afterExec = function () {
      console.log(this.name, time$8.str(), "afterExec");
      sleep(utils$E.getRandom(2, 3, 1000));
      back();
    };

    return actionEat;
  }

  var getActionEat_1 = getActionEat$c;

  var getActionEat$b = getActionEat_1;
  var common$P = common$R;
  var actionEat3$8 = getActionEat$b(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 5, //最早可以开始的时间
      canStartHourEnd: 9, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$P.storage,
    },
    common$P.ad,
    "早餐"
  );
  var aEat1$5 = actionEat3$8;

  var getActionEat$a = getActionEat_1;
  var common$O = common$R;
  var actionEat2$2 = getActionEat$a(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 11, //最早可以开始的时间
      canStartHourEnd: 14, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$O.storage,
    },
    common$O.ad,
    "午餐"
  );
  var aEat2$5 = actionEat2$2;

  var getActionEat$9 = getActionEat_1;
  var common$N = common$R;
  var actionEat3$7 = getActionEat$9(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 17, //最早可以开始的时间
      canStartHourEnd: 20, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$N.storage,
    },
    common$N.ad,
    "晚餐"
  );
  var aEat3$5 = actionEat3$7;

  var getActionEat$8 = getActionEat_1;
  var common$M = common$R;
  var actionEat3$6 = getActionEat$8(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 21, //最早可以开始的时间
      canStartHourEnd: 24, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$M.storage,
    },
    common$M.ad,
    "夜宵"
  );
  var aEat4$5 = actionEat3$6;

  var ACTION$g = action;
  var utils$D = utils_1;
  var time$7 = time_1;
  var ocrGml$t = ocrGml_1;

  function getActionWalk(config, ad, contentType) {
    var actionWalk = new ACTION$g(contentType, config);
    actionWalk.goStart = function () {
      var ocrItem = ocrGml$t.captureExistOne("走路赚钱", true);
      if (ocrItem) {
        this.execFCount++;
        this.updateStorage();
        utils$D.clickOcrItem(ocrItem);
        sleep(utils$D.getRandom(2.5, 3, 1000));
      }
      return ocrItem;
    };

    actionWalk.beforeExec = function () {
      var UIText = utils$D.existsTextMatches(/领取\d+金币/);
      if (UIText) {
        this.execSCount++;
        this.updateStorage();
        utils$D.clickUIText(UIText);
        sleep(utils$D.getRandom(2, 3, 1000));
        return true;
      }
      var UIText = utils$D.existsOneTextStartsWith("还差");
      if (UIText) {
        this.execSCount++;
        this.updateStorage();
        this.afterExec();
        return false;
      }
      return false;
    };
    actionWalk.exec = function () {
      var contents = [
        //prettier-ignore
        "开心收下",
        "立即收下",
      ];
      var UIText = utils$D.existsOneTextStartsWith(contents);
      if (UIText) {
        utils$D.clickUIText(UIText);
        sleep(utils$D.getRandom(2, 3, 1000));
        return;
      }
      var contents = [
        //prettier-ignore
        "看视频再",
        "看广告再",
      ];
      var UIText = utils$D.existsOneTextStartsWith(contents);
      if (UIText) {
        utils$D.clickUIText(UIText);
        sleep(utils$D.getRandom(2, 3, 1000));
        var contents = ["开心收下", "立即收下"];
        var ocrItem = ocrGml$t.captureExistOne(contents, true);
        if (ocrItem) {
          utils$D.clickOcrItem(ocrItem);
          sleep(utils$D.getRandom(2, 3, 1000));
          return;
        }
        ad.init(1, function () {
          var ocrItem = ocrGml$t.captureExistOne([
            "走路奖励",
            "今日步数",
            "活动说明",
          ]);
          return ocrItem;
        });
        return;
      }
    };
    actionWalk.afterExec = function () {
      console.log(this.name, time$7.str(), "afterExec");
      back();
      sleep(utils$D.getRandom(2, 3, 1000));
    };
    return actionWalk;
  }

  var getActionWalk_1 = getActionWalk;

  var getWalkAction$2 = getActionWalk_1;
  var common$L = common$R;
  var actionWalk$2 = getWalkAction$2(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 21, //最早可以开始的时间
      canStartHourEnd: 23, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$L.storage,
    },
    common$L.ad,
    "走路赚钱"
  );
  var aWalk$5 = actionWalk$2;

  var ACTION$f = action;
  var utils$C = utils_1;
  var time$6 = time_1;
  var ocrGml$s = ocrGml_1;

  function getActionSleepGet$3(config, ad, contentType) {
    var actionSleepGet = new ACTION$f(contentType, config);
    actionSleepGet.goStart = function () {
      var ocrItem = ocrGml$s.captureExistOne("睡觉赚钱", true);
      if (ocrItem) {
        this.execFCount++;
        this.updateStorage();
        utils$C.clickOcrItem(ocrItem);
        sleep(utils$C.getRandom(2.5, 3, 1000));
      }
      return ocrItem;
    };
    actionSleepGet.beforeExec = function () {
      var content = "我睡醒了";
      if (utils$C.clickTextStartsWith(content)) {
        this.execSCount++;
        this.updateStorage();
        sleep(utils$C.getRandom(2, 3, 1000));
        return true;
      }
      var content = "后开启";
      var UIText = utils$C.existsTextStartsWith(content);
      if (UIText) {
        this.execSCount++;
        this.updateStorage();
        this.afterExec();
      }
      var content = "后可开启";
      var UIText = utils$C.existsTextEndsWith(content);
      if (UIText) {
        this.execSCount++;
        this.updateStorage();
        this.afterExec();
      }
      return false;
    };
    actionSleepGet.exec = function () {
      var contents = [
        //prettier-ignore
        "领取",
      ];
      var UIText = utils$C.existsOneTextStartsWith(contents);
      if (UIText) {
        utils$C.clickUIText(UIText);
        sleep(utils$C.getRandom(2, 3, 1000));
        var contents = ["开心收下", "立即收下"];
        var ocrItem = ocrGml$s.captureExistOne(contents, true);
        if (ocrItem) {
          utils$C.clickOcrItem(ocrItem);
          sleep(utils$C.getRandom(2, 3, 1000));
          return;
        }
        var contents = ["看视频领", "看广告领", "看视频再领"];
        var ocrItem = ocrGml$s.captureExistOne(contents, true);
        if (ocrItem) {
          utils$C.clickOcrItem(ocrItem);
          sleep(utils$C.getRandom(2, 3, 1000));
          ad.init(1, function () {
            var ocrItem = ocrGml$s.captureExistOne(["收益记录", "活动规则"]);
            return ocrItem;
          });
        }
      }
    };
    actionSleepGet.afterExec = function () {
      console.log(this.name, time$6.str(), "afterExec");
      back();
      sleep(utils$C.getRandom(2, 3, 1000));
    };
    return actionSleepGet;
  }

  var getActionSleepGet_1 = getActionSleepGet$3;

  var getActionSleepGet$2 = getActionSleepGet_1;
  var common$K = common$R;
  var actionSleepGet$2 = getActionSleepGet$2(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 8, //最早可以开始的时间
      canStartHourEnd: 22, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$K.storage,
    },
    common$K.ad,
    "我睡醒了"
  );
  var aSleepGet$5 = actionSleepGet$2;

  var ACTION$e = action;
  var utils$B = utils_1;
  var time$5 = time_1;
  var ocrGml$r = ocrGml_1;

  function getActionSleep$3(config, ad, contentType) {
    var actionSleep = new ACTION$e(contentType, config);
    actionSleep.goStart = function () {
      var ocrItem = ocrGml$r.captureExistOne("睡觉赚钱", true);
      if (ocrItem) {
        this.execFCount++;
        this.updateStorage();
        utils$B.clickOcrItem(ocrItem);
        sleep(utils$B.getRandom(2.5, 3, 1000));
      }
      return ocrItem;
    };
    actionSleep.beforeExec = function () {
      var content = "我要睡了";
      if (utils$B.clickTextStartsWith(content)) {
        this.execSCount++;
        this.updateStorage();
        sleep(utils$B.getRandom(2, 3, 1000));
        return true;
      }
      return false;
    };
    actionSleep.exec = function () {};
    actionSleep.afterExec = function () {
      console.log(this.name, time$5.str(), "afterExec");
      back();
      sleep(utils$B.getRandom(2, 3, 1000));
    };
    return actionSleep;
  }

  var getActionSleep_1 = getActionSleep$3;

  var getActionSleep$2 = getActionSleep_1;
  var common$J = common$R;
  var actionSleep$2 = getActionSleep$2(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 8, //最早可以开始的时间
      canStartHourEnd: 22, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      storage: common$J.storage,
    },
    common$J.ad,
    "我要睡了"
  );
  var aSleep$5 = actionSleep$2;

  var utils$A = utils_1;
  var ocrGml$q = ocrGml_1;
  var ACTION$d = action;
  var common$I = common$R;
  var actionTreasure$4 = new ACTION$d("开宝箱", {
    interval: null, //每个多少秒执行一次
    storage: common$I.storage,
  });
  var inTask$j = inTask_1$4;
  actionTreasure$4.exec = function () {
    var contents = ["开宝箱得金币", "开宝箱"];
    var ocrItem = ocrGml$q.captureExistOne(contents, true);
    if (ocrItem) {
      utils$A.clickOcrItem(ocrItem);
      sleep(utils$A.getRandom(2.5, 3, 1000));
      inTask$j.run();
      return;
    }
  };

  var aTreasure$b = actionTreasure$4;

  var App$5 = app$1;
  var utils$z = utils_1;
  var common$H = common$R;
  var inTask$i = inTask_1$4;
  var aRead$a = aRead$b;
  var aEat1$4 = aEat1$5;
  var aEat2$4 = aEat2$5;
  var aEat3$4 = aEat3$5;
  var aEat4$4 = aEat4$5;
  var aWalk$4 = aWalk$5;
  var aSleepGet$4 = aSleepGet$5;
  var aSleep$4 = aSleep$5;
  var aTreasure$a = aTreasure$b;
  var touTiao = new App$5("今日头条", {
    interval: 10,
    testOpenCount: 3,
    storage: common$H.storage,
  });

  touTiao.as = [
    aEat1$4,
    aEat2$4,
    aEat3$4,
    aEat4$4,
    aSleepGet$4,
    aSleep$4,
    aWalk$4,
  ];
  touTiao.runTest = function () {
    common$H.toTask();
    sleep(utils$z.getRandom(5, 7, 1000));
  };
  touTiao.run = function () {
    aRead$a.flow();
    if (common$H.inHome()) {
      sleep(utils$z.getRandom(1.5, 2, 1000));
      common$H.toTask();
      sleep(utils$z.getRandom(5, 12, 1000));
      inTask$i.run();
      var nextAction = this.getNextAction();
      if (nextAction) {
        nextAction.flow();
      } else {
        aTreasure$a.flow();
      }
    }
  };

  var common$G = {};

  var time$4 = time_1;
  var utils$y = utils_1;
  var ocrGml$p = ocrGml_1;
  var swipeUp$3 = swipeUp_1;
  var swipeDown$3 = swipeDown_1;
  var readArticle$3 = readArticle_1;
  var pointMap$4 = {
    首页任务: {
      points: [
        // prettier-ignore
        648, 2179, 864, 2291,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    搜一搜赚钱搜索: {
      points: [
        // prettier-ignore
        871, 141, 1025, 212,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    抽奖1: {
      points: [
        // prettier-ignore
        69, 723, 363, 1039,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    抽奖2: {
      points: [
        // prettier-ignore
        432, 783, 651, 916,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    抽奖3: {
      points: [
        // prettier-ignore
        745, 772, 990, 944,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    抽奖结束点击领取: {
      points: [
        // prettier-ignore
        274, 1163, 807, 1278,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };
  function inHome$4() {
    // prettier-ignore
    var contents = [
            "首页",
            "我的"
        ];
    var result = ocrGml$p.captureExistAll(contents);
    if (result) {
      console.log("找到-" + contents.join("和") + "-,判断在首页");
    } else {
      console.log("没找到-" + contents.join("和") + "-");
    }
    return result;
  }
  function toTask$4() {
    console.log("前往-首页任务-");
    utils$y.clickPointMap(pointMap$4["首页任务"]);
  }

  function ifHasNextAdDefault$3() {
    var contents = [
      //prettier-ignore
      "看视频领",
      "看视频再领",
      "看视频再得",
      "看广告领",
      "看广告再领",
      "看广告再得",
    ];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      var UIText = utils$y.existsTextStartsWith(content);
      if (UIText) {
        console.log("找到-" + content + "-", ",存在下一个广告可看");
        return {
          result: true,
          trigger: function () {
            utils$y.clickUIText(UIText);
          },
        };
      }
    }
    return {
      result: false,
      trigger: function () {},
    };
  }
  function ifAdOverDefault$3() {
    var UIText = utils$y.existsTextStartsWith("领取成功");
    if (UIText) {
      console.log("找到-领取成功-");
    }
    return UIText;
  }
  function existAdDefault$3() {
    var contents = [
      //prettier-ignore
      "残忍离开",
      "坚持离开",
      "残忍退出",
      "坚持退出",
    ];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      var UIText = utils$y.existsTextStartsWith(content);
      if (UIText) {
        console.log("找到-" + content + "-，", "关闭广告");
        utils$y.clickUIText(UIText);
      }
    }
  }

  var AD_CONST_MIN_INTERVAL$3 = 40;
  var AD_CONST_MAX_GO_BACK_TIMES$3 = 4;

  var ad$3 = {
    inStart: false,
    inHome: false,
    ifHasNextAd: null, //判断是否有下一个广告
    ifAdOver: null, //判断广告实际是否比预计时间提前结束
    ifInStart: null, //判断是否是在任务页
    ifInHome: null, //判断是否在首页
    hasWatchTimes: 0,
    maxTimes: 0,
    init(maxTimes, ifInStart, ifHasNextAd, ifAdOver, exitAd, ifInHome) {
      this.hasWatchTimes = 0;
      this.maxTimes = utils$y.getRandom(maxTimes, maxTimes + 2);
      this.ifInStart = ifInStart;
      this.ifHasNextAd = ifHasNextAd || ifHasNextAdDefault$3;
      this.ifAdOver = ifAdOver || ifAdOverDefault$3;
      this.exitAd = exitAd || existAdDefault$3;
      this.ifInHome = ifInHome || inHome$4;
      console.log("ad init: 本轮最多看-" + this.maxTimes + "-个广告");
      this.run();
    },
    run() {
      //开始看广告
      var adSpan = AD_CONST_MIN_INTERVAL$3 + utils$y.getRandom(0, 5);
      console.log(
        //prettier-ignore
        "ad run: 开始看-" + (this.hasWatchTimes+1) + "-个广告，预计时间-" + adSpan + "-s"
      );
      var checkAdOverSpan = 2; //每隔2s检查当前广告是否已经结束
      var isOverEarly = false;
      var hasWatchSpan = 0;
      var count = 0;
      while (adSpan > checkAdOverSpan) {
        if (hasWatchSpan > 30) {
          if (!utils$y.existsTextStartsWith("广告")) {
            console.log(
              //prettier-ignore
              "ad run: 已过-" + hasWatchSpan + "-s但是没找到-广告-,即将执行一次back()"
            );
            back();
            sleep(utils$y.getRandom(2, 2.5, 1000));
          }
        }
        if (this.ifAdOver && this.ifAdOver()) {
          var waitSpan = utils$y.getRandom(2, 3.5);
          console.log("ad run: 广告已结束,再过" + waitSpan + "s后停止当前广告");
          sleep(waitSpan * 1000);
          isOverEarly = true; //广告实际比预计的时间提前结束
          break;
        }
        sleep(checkAdOverSpan * 1000);
        adSpan = adSpan - checkAdOverSpan;
        hasWatchSpan = hasWatchSpan + checkAdOverSpan;
        count = count + 1;
        if (count % 5 == 0) {
          console.log("ad run: 广告时间预计还剩-" + adSpan + "-s");
        }
      }
      this.hasWatchTimes = this.hasWatchTimes + 1;
      if (isOverEarly) {
        this.goBack();
        return;
      }
      if (adSpan > 0) {
        console.log("ad run: 广告时间还剩最后的" + adSpan + "秒");
        sleep(adSpan * 1000);
        this.goBack();
        return;
      }
    },
    goBack() {
      var index = 0;
      while (index < AD_CONST_MAX_GO_BACK_TIMES$3) {
        console.log("ad goBack: 第" + (index + 1) + "次执行back");
        back();
        sleep(utils$y.getRandom(2.5, 4, 1000));
        var hasNextAd = this.ifHasNextAd();
        if (hasNextAd.result) {
          if (this.hasWatchTimes >= this.maxTimes) {
            console.log(
              //prettier-ignore
              "当前看广告-" + this.hasWatchTimes + "-次，最多看-" + this.maxTimes + "-次，执行exitAd"
            );
            this.exitAd();
            return;
          } else {
            console.log("开始看下一个广告");
            hasNextAd.trigger();
            sleep(utils$y.getRandom(2, 3, 1000));
            this.run();
            return;
          }
        }
        if (this.ifInStart && this.ifInStart()) {
          console.log("ad goBack: 判断在开始页");
          this.inStart = true;
          this.after();
          return;
        }
        if (this.ifInHome && this.ifInHome()) {
          console.log("ad goBack: 判断在app首页");
          this.inHome = true;
          this.after();
          return;
        }
        index = index + 1;
      }
      this.after();
    },
    after() {
      console.log("ad after");
      this.next();
    },
    next() {
      console.log("ad next");
    },
  };
  var storage$4 = utils$y.getStorage(time$4.str("YYYY-MM-DD") + "闪电搜索");
  common$G.toTask = toTask$4;
  common$G.inHome = inHome$4;
  common$G.pointMap = pointMap$4;
  common$G.swipeUp = swipeUp$3;
  common$G.swipeDown = swipeDown$3;
  common$G.readArticle = readArticle$3;
  common$G.ad = ad$3;
  common$G.storage = storage$4;

  var ocrGml$o = ocrGml_1;
  var utils$x = utils_1;
  var common$F = common$G;

  var inTask$h = {
    run(config) {
      if (this.over()) {
        return;
      }
      sleep(utils$x.getRandom(1, 1.5, 1000));
      this.sign();
      sleep(utils$x.getRandom(1, 1.5, 1000));
      if (config && config.fromAd) ; else {
        this.ad();
        sleep(utils$x.getRandom(1, 1.5, 1000));
      }
      if (config && config.fromAward) ; else {
        this.award();
        sleep(utils$x.getRandom(1, 1.5, 1000));
      }
    },
    //点击领取
    award() {
      var contents = ["点击领取"];
      var ocrItem = ocrGml$o.captureExistOne(contents, true);
      if (ocrItem) {
        utils$x.clickOcrItem(ocrItem);
        sleep(utils$x.getRandom(4, 6, 1000));
        var content = "开始抽奖";
        var UIText = utils$x.existsOneTextStartsWith(content);
        if (UIText) {
          utils$x.clickUIText(UIText);
          sleep(utils$x.getRandom(6, 8, 1000));
          var number = utils$x.getRandom(1, 3);
          utils$x.clickPointMap(common$F.pointMap["抽奖" + number]);
          sleep(utils$x.getRandom(4, 6, 1000));
          utils$x.clickPointMap(common$F.pointMap["抽奖结束点击领取"]);
        }
        this.run({
          fromAward: true,
        });
      }
    },
    over() {
      var contents = ["开心收下", "立即收下"];
      var ocrItem = ocrGml$o.captureExistOne(contents, true);
      if (ocrItem) {
        utils$x.clickOcrItem(ocrItem);
        sleep(utils$x.getRandom(2, 3, 1000));
        return true;
      }
    },
    sign() {
      var contents = ["签到领金币"];
      var ocrItem = ocrGml$o.captureExistOne(contents, true);
      if (ocrItem) {
        utils$x.clickPointMap(common$F.pointMap["签到领金币"]);
        sleep(utils$x.getRandom(2, 3, 1000));
        this.run();
      }
    },
    ad() {
      var contents = ["看广告再", "看视频再", "看广告领", "看视频领"];
      var ocrItem = ocrGml$o.captureExistOne(contents, true);
      if (ocrItem) {
        utils$x.clickOcrItem(ocrItem);
        sleep(utils$x.getRandom(2, 3, 1000));
        var contents = [
          "开心收下",
          "立即收下",
          "任务中心",
          "现金收益",
          "我的金币",
        ];
        var ocrItem = ocrGml$o.captureExistOne(contents, true);
        if (ocrItem) {
          sleep(utils$x.getRandom(2, 3, 1000));
          return;
        }
        common$F.ad.init(1, function () {
          var ocrItem = ocrGml$o.captureExistOne([
            "任务中心",
            "现金收益",
            "我的金币",
          ]);
          return ocrItem;
        });
        sleep(utils$x.getRandom(2, 3, 1000));
        this.run({
          fromAd: true,
        });
      }
    },
  };

  var inTask_1$3 = inTask$h;

  var ACTION$c = action;
  var utils$w = utils_1;
  var actionRead$3 = new ACTION$c("阅读");
  var common$E = common$G;
  actionRead$3.startRead = function () {
    var baseSpan = 40;
    var span = utils$w.getRandom(baseSpan, baseSpan + 5);
    console.log("开始看文章-" + span + "-s");
    this.readArticle(span);
  };

  actionRead$3.readArticle = function (span) {
    common$E.readArticle(span, 5);
  };

  actionRead$3.exec = function () {
    this.startRead();
  };

  var aRead$9 = actionRead$3;

  var getActionEat$7 = getActionEat_1;
  var common$D = common$G;
  var actionEat3$5 = getActionEat$7(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 5, //最早可以开始的时间
      canStartHourEnd: 9, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$D.storage,
    },
    common$D.ad,
    "早餐"
  );
  var aEat1$3 = actionEat3$5;

  var getActionEat$6 = getActionEat_1;
  var common$C = common$G;
  var actionEat2$1 = getActionEat$6(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 11, //最早可以开始的时间
      canStartHourEnd: 14, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$C.storage,
    },
    common$C.ad,
    "午餐"
  );
  var aEat2$3 = actionEat2$1;

  var getActionEat$5 = getActionEat_1;
  var common$B = common$G;
  var actionEat3$4 = getActionEat$5(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 17, //最早可以开始的时间
      canStartHourEnd: 20, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$B.storage,
    },
    common$B.ad,
    "晚餐"
  );
  var aEat3$3 = actionEat3$4;

  var getActionEat$4 = getActionEat_1;
  var common$A = common$G;
  var actionEat3$3 = getActionEat$4(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 21, //最早可以开始的时间
      canStartHourEnd: 24, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$A.storage,
    },
    common$A.ad,
    "夜宵"
  );
  var aEat4$3 = actionEat3$3;

  var getActionSleepGet$1 = getActionSleepGet_1;
  var common$z = common$G;
  var actionSleepGet$1 = getActionSleepGet$1(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 8, //最早可以开始的时间
      canStartHourEnd: 22, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$z.storage,
    },
    common$z.ad,
    "我睡醒了"
  );
  var aSleepGet$3 = actionSleepGet$1;

  var getActionSleep$1 = getActionSleep_1;
  var common$y = common$G;
  var actionSleep$1 = getActionSleep$1(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 8, //最早可以开始的时间
      canStartHourEnd: 22, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      storage: common$y.storage,
    },
    common$y.ad,
    "我要睡了"
  );
  var aSleep$3 = actionSleep$1;

  var getWalkAction$1 = getActionWalk_1;
  var common$x = common$G;
  var actionWalk$1 = getWalkAction$1(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 14, //最早可以开始的时间
      canStartHourEnd: 23, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$x.storage,
    },
    common$x.ad,
    "走路赚钱"
  );
  var aWalk$3 = actionWalk$1;

  var ACTION$b = action;
  var utils$v = utils_1;
  var ocrGml$n = ocrGml_1;
  var common$w = common$G;
  var actionSearch5$1 = new ACTION$b("搜一搜赚钱", {
    execSCount: 0,
    execFCount: 0,
    maxExecSCount: 5,
    maxExecFCount: 5,
    storage: common$w.storage,
  });
  actionSearch5$1.exec = function () {
    var ocrItem = ocrGml$n.findTextOne(
      ["搜一搜赚钱"],
      true,
      null,
      1,
      device.height / 10
    );
    if (ocrItem) {
      var point = utils$v.getOcrItemPoint(ocrItem);
      var x = point.x;
      var y = point.y;
      utils$v.clickXY(x, y);
      sleep(utils$v.getRandom(2, 3, 1000));
      for (var index = 0; index < 1; index++) {
        utils$v.clickPointMap(common$w.pointMap["搜一搜赚钱搜索"]);
        sleep(utils$v.getRandom(2, 3, 1000));
        var baseSpan = 15;
        var span = utils$v.getRandom(baseSpan, baseSpan + 5);
        common$w.readArticle(span, 5);
        back();
        sleep(utils$v.getRandom(2, 3, 1000));
        if (utils$v.clickTextStartsWith("残忍离开")) {
          console.log("actionSearch5", "找到-残忍离开-");
          sleep(utils$v.getRandom(2, 3, 1000));
        } else {
          console.log("actionSearch5", "没找到-残忍离开-");
        }
        back();
        sleep(utils$v.getRandom(2, 3, 1000));
        if (utils$v.clickTextStartsWith("残忍离开")) {
          console.log("actionSearch5", "找到-残忍离开-");
          sleep(utils$v.getRandom(2, 3, 1000));
        } else {
          console.log("actionSearch5", "没找到-残忍离开-");
        }
      }
      this.execSCount++;
      this.updateStorage();
      back();
    } else {
      this.execFCount++;
      this.updateStorage();
    }
  };

  var aSearch5$3 = actionSearch5$1;

  var ACTION$a = action;
  var utils$u = utils_1;
  var ocrGml$m = ocrGml_1;
  var common$v = common$G;
  var actionSleep30 = new ACTION$a("随机搜赚钱", {
    execSCount: 0,
    execFCount: 0,
    maxExecSCount: 30,
    maxExecFCount: 5,
    storage: common$v.storage,
  });
  actionSleep30.exec = function () {
    var ocrItem = ocrGml$m.findTextOne(
      ["随机搜赚钱"],
      true,
      null,
      1,
      device.height / 10
    );
    if (ocrItem) {
      var point = utils$u.getOcrItemPoint(ocrItem);
      var x = point.x;
      var y = point.y;
      for (var index = 0; index < 2; index++) {
        utils$u.clickXY(x, y);
        sleep(utils$u.getRandom(2, 3, 1000));
        var baseSpan = 15;
        var span = utils$u.getRandom(baseSpan, baseSpan + 5);
        common$v.readArticle(span, 5);
        back();
        sleep(utils$u.getRandom(2, 3, 1000));
        if (utils$u.clickTextStartsWith("残忍离开")) {
          console.log("actionSleep30", "找到-残忍离开-");
          sleep(utils$u.getRandom(2, 3, 1000));
        } else {
          console.log("actionSleep30", "没找到-残忍离开-");
        }
      }
      this.execSCount = this.execSCount + 2;
      this.updateStorage();
    } else {
      this.execFCount++;
      this.updateStorage();
    }
  };

  var aSearch30$1 = actionSleep30;

  var utils$t = utils_1;
  var ocrGml$l = ocrGml_1;
  var ACTION$9 = action;
  var actionTreasure$3 = new ACTION$9("开宝箱");
  actionTreasure$3.exec = function () {
    var contents = ["开宝箱得金币"];
    var ocrItem = ocrGml$l.captureExistOne(contents, true);
    if (ocrItem) {
      utils$t.clickOcrItem(ocrItem);
      sleep(utils$t.getRandom(2.5, 3, 1000));
      var contents = ["开心收下", "立即收下"];
      var ocrItem = ocrGml$l.captureExistOne(contents, true);
      if (ocrItem) {
        utils$t.clickOcrItem(ocrItem);
        sleep(utils$t.getRandom(2, 3, 1000));
        return;
      }
      return;
    }
  };

  var aTreasure$9 = actionTreasure$3;

  var App$4 = app$1;
  var utils$s = utils_1;
  var common$u = common$G;
  var inTask$g = inTask_1$3;
  var shanDianSouSuo = new App$4("闪电搜索", {
    interval: 10,
  });
  var aRead$8 = aRead$9;
  var aEat1$2 = aEat1$3;
  var aEat2$2 = aEat2$3;
  var aEat3$2 = aEat3$3;
  var aEat4$2 = aEat4$3;
  var aSleepGet$2 = aSleepGet$3;
  var aSleep$2 = aSleep$3;
  var aWalk$2 = aWalk$3;
  var aSearch5$2 = aSearch5$3;
  var aSearch30 = aSearch30$1;
  var aTreasure$8 = aTreasure$9;
  shanDianSouSuo.as = [
    aEat1$2,
    aEat2$2,
    aEat3$2,
    aEat4$2,
    aSleepGet$2,
    aSleep$2,
    aWalk$2,
  ];
  shanDianSouSuo.run = function () {
    var content = "去悟空浏览器";
    if (utils$s.clickTextStartsWith(content)) {
      sleep(utils$s.getRandom(5, 7, 1000));
      this.runCount = this.runCount + 1;
      this.close();
      return;
    }
    aRead$8.flow();
    if (common$u.inHome()) {
      sleep(utils$s.getRandom(1.5, 2, 1000));
      common$u.toTask();
      sleep(utils$s.getRandom(5, 12, 1000));
      utils$s.swipeX(
        device.width / 2,
        (device.height / 10) * 5,
        device.width / 2,
        (device.height / 10) * 8,
        utils$s.getRandom(500, 800)
      );
      sleep(utils$s.getRandom(1.5, 2, 1000));
      inTask$g.run();
      var nextAction = this.getNextAction();
      if (nextAction) {
        nextAction.flow();
      } else {
        aSearch5$2.flow();
        aSearch30.flow();
        aTreasure$8.flow();
      }
    }
  };

  var common$t = {};

  var time$3 = time_1;
  var utils$r = utils_1;
  var ocrGml$k = ocrGml_1;
  var swipeUp$2 = swipeUp_1;
  var swipeDown$2 = swipeDown_1;
  var readArticle$2 = readArticle_1;
  var pointMap$3 = {
    首页任务: {
      points: [
        // prettier-ignore
        648, 2153, 864, 2274,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    签到领金币: {
      points: [
        // prettier-ignore
        220, 1415, 886, 1564,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    抽奖1: {
      points: [
        // prettier-ignore
        69, 723, 363, 1039,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    抽奖2: {
      points: [
        // prettier-ignore
        432, 783, 651, 916,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    抽奖3: {
      points: [
        // prettier-ignore
        745, 772, 990, 944,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    抽奖结束点击领取: {
      points: [
        // prettier-ignore
        274, 1163, 807, 1278,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    搜一搜赚钱搜索: {
      points: [
        // prettier-ignore
        871, 141, 1025, 212,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };
  function inHome$3() {
    // prettier-ignore
    var contents = [
            "首页",
            "我的"
        ];
    var result = ocrGml$k.captureExistAll(contents);
    if (result) {
      console.log("找到-" + contents.join("和") + "-,判断在首页");
    } else {
      console.log("没找到-" + contents.join("和") + "-");
    }
    return result;
  }
  function toTask$3() {
    console.log("前往-首页任务-");
    utils$r.clickPointMap(pointMap$3["首页任务"]);
  }
  function ifHasNextAdDefault$2() {
    var contents = [
      //prettier-ignore
      "看视频领",
      "看视频再领",
      "看视频再得",
      "看广告领",
      "看广告再领",
      "看广告再得",
    ];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      var UIText = utils$r.existsTextStartsWith(content);
      if (UIText) {
        console.log("找到-" + content + "-", ",存在下一个广告可看");
        return {
          result: true,
          trigger: function () {
            utils$r.clickUIText(UIText);
          },
        };
      }
    }
    return {
      result: false,
      trigger: function () {},
    };
  }
  function ifAdOverDefault$2() {
    var UIText = utils$r.existsTextStartsWith("领取成功");
    if (UIText) {
      console.log("找到-领取成功-");
    }
    return UIText;
  }
  function existAdDefault$2() {
    var contents = [
      //prettier-ignore
      "残忍离开",
      "坚持离开",
      "残忍退出",
      "坚持退出",
    ];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      var UIText = utils$r.existsTextStartsWith(content);
      if (UIText) {
        console.log("找到-" + content + "-，", "关闭广告");
        utils$r.clickUIText(UIText);
      }
    }
  }

  var AD_CONST_MIN_INTERVAL$2 = 40;
  var AD_CONST_MAX_GO_BACK_TIMES$2 = 4;

  var ad$2 = {
    inStart: false,
    inHome: false,
    ifHasNextAd: null, //判断是否有下一个广告
    ifAdOver: null, //判断广告实际是否比预计时间提前结束
    ifInStart: null, //判断是否是在任务页
    ifInHome: null, //判断是否在首页
    hasWatchTimes: 0,
    maxTimes: 0,
    init(maxTimes, ifInStart, ifHasNextAd, ifAdOver, exitAd, ifInHome) {
      this.hasWatchTimes = 0;
      this.maxTimes = utils$r.getRandom(maxTimes, maxTimes + 2);
      this.ifInStart = ifInStart;
      this.ifHasNextAd = ifHasNextAd || ifHasNextAdDefault$2;
      this.ifAdOver = ifAdOver || ifAdOverDefault$2;
      this.exitAd = exitAd || existAdDefault$2;
      this.ifInHome = ifInHome || inHome$3;
      console.log("ad init: 本轮最多看-" + this.maxTimes + "-个广告");
      this.run();
    },
    run() {
      //开始看广告
      var adSpan = AD_CONST_MIN_INTERVAL$2 + utils$r.getRandom(0, 5);
      console.log(
        //prettier-ignore
        "ad run: 开始看-" + (this.hasWatchTimes+1) + "-个广告，预计时间-" + adSpan + "-s"
      );
      var checkAdOverSpan = 2; //每隔2s检查当前广告是否已经结束
      var isOverEarly = false;
      var hasWatchSpan = 0;
      var count = 0;
      while (adSpan > checkAdOverSpan) {
        if (hasWatchSpan > 30) {
          if (!utils$r.existsTextStartsWith("广告")) {
            console.log(
              //prettier-ignore
              "ad run: 已过-" + hasWatchSpan + "-s但是没找到-广告-,即将执行一次back()"
            );
            back();
            sleep(utils$r.getRandom(2, 2.5, 1000));
          }
        }
        if (this.ifAdOver && this.ifAdOver()) {
          var waitSpan = utils$r.getRandom(2, 3.5);
          console.log("ad run: 广告已结束,再过" + waitSpan + "s后停止当前广告");
          sleep(waitSpan * 1000);
          isOverEarly = true; //广告实际比预计的时间提前结束
          break;
        }
        sleep(checkAdOverSpan * 1000);
        adSpan = adSpan - checkAdOverSpan;
        hasWatchSpan = hasWatchSpan + checkAdOverSpan;
        count = count + 1;
        if (count % 5 == 0) {
          console.log("ad run: 广告时间预计还剩-" + adSpan + "-s");
        }
      }
      this.hasWatchTimes = this.hasWatchTimes + 1;
      if (isOverEarly) {
        this.goBack();
        return;
      }
      if (adSpan > 0) {
        console.log("ad run: 广告时间还剩最后的" + adSpan + "秒");
        sleep(adSpan * 1000);
        this.goBack();
        return;
      }
    },
    goBack() {
      var index = 0;
      while (index < AD_CONST_MAX_GO_BACK_TIMES$2) {
        console.log("ad goBack: 第" + (index + 1) + "次执行back");
        back();
        sleep(utils$r.getRandom(2.5, 4, 1000));
        var hasNextAd = this.ifHasNextAd();
        if (hasNextAd.result) {
          if (this.hasWatchTimes >= this.maxTimes) {
            console.log(
              //prettier-ignore
              "当前看广告-" + this.hasWatchTimes + "-次，最多看-" + this.maxTimes + "-次，执行exitAd"
            );
            this.exitAd();
            return;
          } else {
            console.log("开始看下一个广告");
            hasNextAd.trigger();
            sleep(utils$r.getRandom(2, 3, 1000));
            this.run();
            return;
          }
        }
        if (this.ifInStart && this.ifInStart()) {
          console.log("ad goBack: 判断在开始页");
          this.inStart = true;
          this.after();
          return;
        }
        if (this.ifInHome && this.ifInHome()) {
          console.log("ad goBack: 判断在app首页");
          this.inHome = true;
          this.after();
          return;
        }
        index = index + 1;
      }
      this.after();
    },
    after() {
      console.log("ad after");
      this.next();
    },
    next() {
      console.log("ad next");
    },
  };

  var storage$3 = utils$r.getStorage(time$3.str("YYYY-MM-DD") + "有柿");
  common$t.toTask = toTask$3;
  common$t.inHome = inHome$3;
  common$t.pointMap = pointMap$3;
  common$t.swipeUp = swipeUp$2;
  common$t.swipeDown = swipeDown$2;
  common$t.readArticle = readArticle$2;
  common$t.ad = ad$2;
  common$t.storage = storage$3;

  var ocrGml$j = ocrGml_1;
  var utils$q = utils_1;
  var common$s = common$t;

  var inTask$f = {
    run(config) {
      this.over();
      sleep(utils$q.getRandom(1, 1.5, 1000));
      this.sign();
      sleep(utils$q.getRandom(1, 1.5, 1000));
      if (this.ad()) {
        return;
      }
      sleep(utils$q.getRandom(1, 1.5, 1000));
      this.award();
    },
    //点击领取
    award() {
      var contents = ["点击领取"];
      var ocrItem = ocrGml$j.captureExistOne(contents, true);
      if (ocrItem) {
        utils$q.clickOcrItem(ocrItem);
        sleep(utils$q.getRandom(4, 6, 1000));
        var content = "开始抽奖";
        var UIText = utils$q.existsOneTextStartsWith(content);
        if (UIText) {
          utils$q.clickUIText(UIText);
          sleep(utils$q.getRandom(6, 8, 1000));
          var number = utils$q.getRandom(1, 3);
          utils$q.clickPointMap(common$s.pointMap["抽奖" + number]);
          sleep(utils$q.getRandom(4, 6, 1000));
          utils$q.clickPointMap(common$s.pointMap["抽奖结束点击领取"]);
        }
        this.run({
          fromAward: true,
        });
      }
    },
    over() {
      var contents = ["开心收下", "立即收下"];
      var ocrItem = ocrGml$j.captureExistOne(contents, true);
      if (ocrItem) {
        utils$q.clickOcrItem(ocrItem);
        sleep(utils$q.getRandom(2, 3, 1000));
        return;
      }
    },
    sign() {
      var contents = ["签到领金币"];
      var ocrItem = ocrGml$j.captureExistOne(contents, true);
      if (ocrItem) {
        utils$q.clickPointMap(common$s.pointMap["签到领金币"]);
        sleep(utils$q.getRandom(2, 3, 1000));
        return;
      }
    },
    ad() {
      var contents = ["看广告再", "看视频再", "看广告领", "看视频领"];
      var ocrItem = ocrGml$j.captureExistOne(contents, true);
      if (ocrItem) {
        utils$q.clickOcrItem(ocrItem);
        sleep(utils$q.getRandom(2, 3, 1000));
        var contents = [
          "开心收下",
          "立即收下",
          "任务中心",
          "现金收益",
          "我的金币",
        ];
        var ocrItem = ocrGml$j.captureExistOne(contents, true);
        if (ocrItem) {
          sleep(utils$q.getRandom(2, 3, 1000));
          return false;
        }
        common$s.ad.init(1, function () {
          var ocrItem = ocrGml$j.captureExistOne([
            "任务中心",
            "现金收益",
            "我的金币",
          ]);
          return ocrItem;
        });
        sleep(utils$q.getRandom(2, 3, 1000));
        this.run({
          fromAd: true,
        });
        return true;
      }
    },
  };

  var inTask_1$2 = inTask$f;

  var ACTION$8 = action;
  var utils$p = utils_1;
  var actionRead$2 = new ACTION$8("阅读");
  var common$r = common$t;
  actionRead$2.startRead = function () {
    var baseSpan = 40;
    var span = utils$p.getRandom(baseSpan, baseSpan + 5);
    console.log("开始看文章-" + span + "-s");
    this.readArticle(span);
  };

  actionRead$2.readArticle = function (span) {
    common$r.readArticle(span, 5);
  };

  actionRead$2.exec = function () {
    this.startRead();
  };

  var aRead$7 = actionRead$2;

  var getActionEat$3 = getActionEat_1;
  var common$q = common$t;
  var actionEat3$2 = getActionEat$3(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 5, //最早可以开始的时间
      canStartHourEnd: 9, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$q.storage,
    },
    common$q.ad,
    "早餐"
  );
  var aEat1$1 = actionEat3$2;

  var getActionEat$2 = getActionEat_1;
  var common$p = common$t;
  var actionEat2 = getActionEat$2(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 11, //最早可以开始的时间
      canStartHourEnd: 14, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$p.storage,
    },
    common$p.ad,
    "午餐"
  );
  var aEat2$1 = actionEat2;

  var getActionEat$1 = getActionEat_1;
  var common$o = common$t;
  var actionEat3$1 = getActionEat$1(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 17, //最早可以开始的时间
      canStartHourEnd: 20, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$o.storage,
    },
    common$o.ad,
    "晚餐"
  );
  var aEat3$1 = actionEat3$1;

  var getActionEat = getActionEat_1;
  var common$n = common$t;
  var actionEat3 = getActionEat(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 21, //最早可以开始的时间
      canStartHourEnd: 24, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$n.storage,
    },
    common$n.ad,
    "夜宵"
  );
  var aEat4$1 = actionEat3;

  var getWalkAction = getActionWalk_1;
  var common$m = common$t;
  var actionWalk = getWalkAction(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 14, //最早可以开始的时间
      canStartHourEnd: 23, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$m.storage,
    },
    common$m.ad,
    "走路赚钱"
  );
  var aWalk$1 = actionWalk;

  var getActionSleepGet = getActionSleepGet_1;
  var common$l = common$t;
  var actionSleepGet = getActionSleepGet(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 8, //最早可以开始的时间
      canStartHourEnd: 22, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      maxTotalExecCount: 2, //最大总执行次数
      storage: common$l.storage,
    },
    common$l.ad,
    "我睡醒了"
  );
  var aSleepGet$1 = actionSleepGet;

  var getActionSleep = getActionSleep_1;
  var common$k = common$t;
  var actionSleep = getActionSleep(
    {
      interval: null, //每个多少秒执行一次
      canStartHour: 8, //最早可以开始的时间
      canStartHourEnd: 22, //最晚可以开始的时间
      lastStartTime: null, //上一次的开始时间
      lastEndTime: null, //上一次的结束时间
      execSCount: 0, //执行成功次数
      execFCount: 0, //执行失败次数
      maxExecSCount: 1, //最大成功执行次数
      maxExecFCount: 2, //最大失败执行次数
      storage: common$k.storage,
    },
    common$k.ad,
    "我要睡了"
  );
  var aSleep$1 = actionSleep;

  var utils$o = utils_1;
  var ocrGml$i = ocrGml_1;
  var ACTION$7 = action;
  var actionTreasure$2 = new ACTION$7("开宝箱");
  var inTask$e = inTask_1$2;
  // actionTreasure.goStart = function () {
  //   if (common.inHome()) {
  //     sleep(utils.getRandom(1.5, 2, 1000));
  //     common.toTask();
  //     sleep(utils.getRandom(5, 12, 1000));
  //     return true;
  //   }
  // };
  actionTreasure$2.exec = function () {
    inTask$e.run();
    var contents = ["开宝箱得金币"];
    var ocrItem = ocrGml$i.captureExistOne(contents, true);
    if (ocrItem) {
      utils$o.clickOcrItem(ocrItem);
      sleep(utils$o.getRandom(2.5, 3, 1000));
      inTask$e.run();
      return;
    }
  };

  var aTreasure$7 = actionTreasure$2;

  var App$3 = app$1;
  var utils$n = utils_1;
  var common$j = common$t;
  var youShi = new App$3("有柿", {
    interval: 10,
  });
  var inTask$d = inTask_1$2;
  var aRead$6 = aRead$7;
  var aEat1 = aEat1$1;
  var aEat2 = aEat2$1;
  var aEat3 = aEat3$1;
  var aEat4 = aEat4$1;
  var aWalk = aWalk$1;
  var aSleepGet = aSleepGet$1;
  var aSleep = aSleep$1;
  var aTreasure$6 = aTreasure$7;
  youShi.as = [aEat1, aEat2, aEat3, aEat4, aSleepGet, aSleep, aWalk];
  youShi.run = function () {
    aRead$6.flow();
    if (common$j.inHome()) {
      sleep(utils$n.getRandom(1.5, 2, 1000));
      common$j.toTask();
      sleep(utils$n.getRandom(5, 12, 1000));
      inTask$d.run();
      var nextAction = this.getNextAction();
      if (nextAction) {
        nextAction.flow();
      } else {
        aTreasure$6.flow();
      }
    }
  };

  var common$i = {};

  var utils$m = utils_1;
  var time$2 = time_1;
  var ocrGml$h = ocrGml_1;
  var pointMap$2 = {
    首页任务: {
      points: [
        // prettier-ignore
        648, 2162, 864, 2296,
      ],
      size: {
        x: 1080,
        y: 2400,
      },
    },
  };
  function inHome$2() {
    // prettier-ignore
    var contents = [
            "首页",
            "我"
        ];
    var result = ocrGml$h.captureExistAll(contents);
    if (result) {
      console.log("找到-" + contents.join("和") + "-,判断在首页");
    } else {
      console.log("没找到-" + contents.join("和") + "-");
    }
    return result;
  }
  function toTask$2() {
    console.log("前往-首页任务-");
    utils$m.clickPointMap(pointMap$2["首页任务"]);
  }

  var storage$2 = utils$m.getStorage(time$2.str("YYYY-MM-DD") + "快手极速");
  common$i.toTask = toTask$2;
  common$i.inHome = inHome$2;
  common$i.storage = storage$2;

  var utils$l = utils_1;
  function nextVideo$1() {
    utils$l.swipeX(
      ((device.width / 2) * utils$l.getRandom(90, 100)) / 100,
      ((device.height / 10) * 8 * utils$l.getRandom(90, 100)) / 100,
      ((device.width / 2) * utils$l.getRandom(90, 100)) / 100,
      ((device.height / 10) * 2 * utils$l.getRandom(90, 100)) / 100,
      utils$l.getRandom(500, 1000, 1)
    );
  }
  var nextVideo_1 = nextVideo$1;

  var utils$k = utils_1;
  var ocrGml$g = ocrGml_1;
  var nextVideo = nextVideo_1;
  var common$h = common$i;
  var ACTION$6 = action;
  var actionRead$1 = new ACTION$6("看视频", {
    interval: null, //每个多少秒执行一次
    canStartHour: null, //最早可以开始的时间
    canStartHourEnd: null, //最晚可以开始的时间
    lastStartTime: null, //上一次的开始时间
    lastEndTime: null, //上一次的结束时间
    execSCount: 0, //执行成功次数
    execFCount: 0, //执行失败次数
    maxExecSCount: null, //最大成功执行次数
    maxExecFCount: null, //最大失败执行次数
    maxTotalExecCount: null, //最大总执行次数
    storage: common$h.storage,
  });

  actionRead$1.read = function () {
    console.show();
    var content = "点击翻倍";
    var ocrItem = ocrGml$g.captureExistOne(content, true);
    if (ocrItem) {
      utils$k.clickOcrItem(ocrItem);
      sleep(utils$k.getRandom(2, 3, 1000));
    }
    nextVideo();
    var execSCount = this.getStorage().execSCount || 0;
    console.log("已经运行-" + execSCount + "-次");
    var baseSpan = 6 + execSCount > 10 ? 10 : execSCount;
    var span = utils$k.getRandom(baseSpan, baseSpan + 2, 1);
    for (var index = 0; index < span; index++) {
      var baseInterval = 8;
      var interval = utils$k.getRandom(baseInterval, baseInterval + 4);
      console.log(
        this.name,
        "read",
        "看第-" + (index + 1) + "/" + span + "-个视频，将看-" + interval + "-s"
      );
      var jumpVideo = this.checkIfJumpVideo(interval);
      if (jumpVideo) {
        index = index - 1;
        continue;
      }
      if (index < span - 1) {
        nextVideo();
      }
    }
    console.hide();
  };

  actionRead$1.checkIfJumpVideo = function (interval) {
    var hasWatch = 0;
    var hasCheck = 0;
    while (hasWatch < interval) {
      var baseWait = 3;
      var wait = utils$k.getRandom(baseWait, baseWait + 3);
      sleep(wait * 1000);
      var contents = ["直播间"];
      if (hasCheck < 1 && ocrGml$g.captureExistOne(contents, true)) {
        sleep(utils$k.getRandom(1, 1.5, 1000));
        nextVideo();
        return true;
      }
      hasCheck = hasCheck + 1;
      hasWatch = hasWatch + wait;
    }
    return false;
  };

  actionRead$1.exec = function () {
    this.read();
    this.execSCount++;
    this.updateStorage();
  };

  var aRead$5 = actionRead$1;

  var utils$j = utils_1;
  var ocrGml$f = ocrGml_1;
  var common$g = common$i;
  var ACTION$5 = action;
  var actionTreasure$1 = new ACTION$5("开宝箱", {
    interval: null, //每个多少秒执行一次
    canStartHour: null, //最早可以开始的时间
    canStartHourEnd: null, //最晚可以开始的时间
    lastStartTime: null, //上一次的开始时间
    lastEndTime: null, //上一次的结束时间
    execSCount: 0, //执行成功次数
    execFCount: 0, //执行失败次数
    maxExecSCount: null, //最大成功执行次数
    maxExecFCount: null, //最大失败执行次数
    maxTotalExecCount: null, //最大总执行次数
    storage: common$g.storage,
  });
  actionTreasure$1.goStart = function () {
    if (common$g.inHome()) {
      sleep(utils$j.getRandom(1.5, 2, 1000));
      common$g.toTask();
      sleep(utils$j.getRandom(10, 12, 1000));
      return true;
    }
  };
  actionTreasure$1.exec = function () {
    var contents = ["点就领", "立即领取"];
    var ocrItem = ocrGml$f.captureExistOne(contents, true);
    if (ocrItem) {
      utils$j.clickOcrItem(ocrItem);
      sleep(utils$j.getRandom(2.5, 3, 1000));
      return;
    }
    var contents = ["明天领金币", "明天再来", "明日再来"];
    var ocrItem = ocrGml$f.captureExistOne(contents, true);
    if (ocrItem) {
      this.isOver = true;
      return;
    }
  };
  actionTreasure$1.afterExec = function () {
    var contents = ["先去看精彩视频"];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      if (utils$j.clickTextStartsWith(content)) {
        console.log(this.name, "afterExec", "找到-" + content + "-");
        sleep(utils$j.getRandom(1.5, 2, 1000));
        return;
      }
    }
  };

  var aTreasure$5 = actionTreasure$1;

  var App$2 = app$1;
  var utils$i = utils_1;
  var common$f = common$i;
  var kuaiShouJiSu = new App$2("快手极速版", {
    interval: 10,
    testOpenCount: 3,
    storage: common$f.storage,
  });
  var aRead$4 = aRead$5;
  var aTreasure$4 = aTreasure$5;
  kuaiShouJiSu.runTest = function () {
    common$f.toTask();
    sleep(utils$i.getRandom(3, 7, 1000));
  };
  kuaiShouJiSu.run = function () {
    aRead$4.flow();
    aTreasure$4.flow();
  };

  var common$e = {};

  var utils$h = utils_1;
  var time$1 = time_1;
  var ocrGml$e = ocrGml_1;
  var readArticle$1 = readArticle_1;
  var swipeUp$1 = swipeUp_1;
  var swipeDown$1 = swipeDown_1;
  var pointMap$1 = {
    首页任务: {
      points: [
        // prettier-ignore
        418, 2180, 660, 2296,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    首页我的: {
      points: [
        // prettier-ignore
        858, 2180, 1056, 2296,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    微信提现关闭: {
      points: [
        // prettier-ignore
        847, 599, 885, 638,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };
  function inHome$1() {
    // prettier-ignore
    var contents = [
            "视频",
            "小说"
        ];
    var result = ocrGml$e.captureExistAll(contents);
    if (result) {
      console.log("找到-" + contents.join("和") + "-,判断在首页");
    } else {
      console.log("没找到-" + contents.join("和") + "-");
    }
    return result;
  }
  function toTask$1() {
    console.log("前往-首页任务-");
    utils$h.clickPointMap(pointMap$1["首页任务"]);
  }

  function ifHasNextAdDefault$1() {
    var contents = [
      //prettier-ignore
      "看视频领",
      "看视频再领",
      "看视频再得",
      "看广告领",
      "看广告再领",
      "看广告再得",
      "再看一个",
      "再看1个",
    ];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      var UIText = utils$h.existsTextStartsWith(content);
      if (UIText) {
        console.log("找到-" + content + "-", ",存在下一个广告可看");
        return {
          result: true,
          trigger: function () {
            utils$h.clickUIText(UIText);
          },
        };
      }
    }
    return {
      result: false,
      trigger: function () {},
    };
  }
  function ifAdOverDefault$1() {
    var UIText = utils$h.existsTextStartsWith("领取成功");
    if (UIText) {
      console.log("找到-领取成功-");
      return UIText;
    }
    var UIText = utils$h.existsTextStartsWith("已领取");
    if (UIText) {
      console.log("找到-已领取-");
      return UIText;
    }
    var UIText = utils$h.existsTextStartsWith("已完成任务 ");
    if (UIText) {
      console.log("找到-已完成任务 -");
      return UIText;
    }
  }
  function existAdDefault$1() {
    var contents = [
      //prettier-ignore
      "残忍离开",
      "坚持离开",
      "残忍退出",
      "坚持退出",
    ];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      var UIText = utils$h.existsTextStartsWith(content);
      if (UIText) {
        console.log("找到-" + content + "-，", "关闭广告");
        utils$h.clickUIText(UIText);
      }
    }
  }

  var AD_CONST_MIN_INTERVAL$1 = 40;
  var AD_CONST_MAX_GO_BACK_TIMES$1 = 4;

  var ad$1 = {
    inStart: false,
    inHome: false,
    ifHasNextAd: null, //判断是否有下一个广告
    ifAdOver: null, //判断广告实际是否比预计时间提前结束
    ifInStart: null, //判断是否是在任务页
    ifInHome: null, //判断是否在首页
    hasWatchTimes: 0,
    maxTimes: 0,
    init(maxTimes, ifInStart, ifHasNextAd, ifAdOver, exitAd, ifInHome) {
      this.hasWatchTimes = 0;
      this.maxTimes = utils$h.getRandom(maxTimes, maxTimes + 2);
      this.ifInStart = ifInStart;
      this.ifHasNextAd = ifHasNextAd || ifHasNextAdDefault$1;
      this.ifAdOver = ifAdOver || ifAdOverDefault$1;
      this.exitAd = exitAd || existAdDefault$1;
      this.ifInHome = ifInHome || inHome$1;
      console.show();
      console.log("ad init: 本轮最多看-" + this.maxTimes + "-个广告");
      this.run();
    },
    run() {
      //开始看广告
      var adSpan = AD_CONST_MIN_INTERVAL$1 + utils$h.getRandom(0, 5);
      console.log(
        //prettier-ignore
        "ad run: 开始看-" + (this.hasWatchTimes+1)+"/" + this.maxTimes + "-个广告，预计时间-" + adSpan + "-s"
      );
      var checkAdOverSpan = 2; //每隔2s检查当前广告是否已经结束
      var isOverEarly = false;
      var hasWatchSpan = 0;
      var count = 0;
      while (adSpan > checkAdOverSpan) {
        if (hasWatchSpan > 30) {
          if (!utils$h.existsTextStartsWith("广告")) {
            console.log(
              //prettier-ignore
              "ad run: 已过-" + hasWatchSpan + "-s但是没找到-广告-,即将执行一次back()"
            );
            back();
            sleep(utils$h.getRandom(2, 2.5, 1000));
          }
        }
        if (this.ifAdOver && this.ifAdOver()) {
          var waitSpan = utils$h.getRandom(2, 3.5);
          console.log("ad run: 广告已结束,再过" + waitSpan + "s后停止当前广告");
          sleep(waitSpan * 1000);
          isOverEarly = true; //广告实际比预计的时间提前结束
          break;
        }
        sleep(checkAdOverSpan * 1000);
        adSpan = adSpan - checkAdOverSpan;
        hasWatchSpan = hasWatchSpan + checkAdOverSpan;
        count = count + 1;
        if (count % 5 == 0) {
          console.log("ad run: 广告时间预计还剩-" + adSpan + "-s");
        }
      }
      this.hasWatchTimes = this.hasWatchTimes + 1;
      if (isOverEarly) {
        this.goBack();
        return;
      }
      if (adSpan > 0) {
        console.log("ad run: 广告时间还剩最后的" + adSpan + "秒");
        sleep(adSpan * 1000);
        this.goBack();
        return;
      }
    },
    goBack() {
      var index = 0;
      while (index < AD_CONST_MAX_GO_BACK_TIMES$1) {
        console.log("ad goBack: 第" + (index + 1) + "次执行back");
        back();
        sleep(utils$h.getRandom(2.5, 4, 1000));
        var hasNextAd = this.ifHasNextAd();
        if (hasNextAd.result) {
          if (this.hasWatchTimes >= this.maxTimes) {
            console.log(
              //prettier-ignore
              "当前看广告-" + this.hasWatchTimes + "-次，最多看-" + this.maxTimes + "-次，执行exitAd"
            );
            this.exitAd();
            this.after();
            return;
          } else {
            hasNextAd.trigger();
            sleep(utils$h.getRandom(2, 3, 1000));
            this.run();
            return;
          }
        }
        if (this.ifInStart && this.ifInStart()) {
          console.log("ad goBack: 判断在开始页");
          this.inStart = true;
          this.after();
          return;
        }
        if (this.ifInHome && this.ifInHome()) {
          console.log("ad goBack: 判断在app首页");
          this.inHome = true;
          this.after();
          return;
        }
        index = index + 1;
      }
      this.after();
    },
    after() {
      console.log("ad after");
      console.hide();
      this.next();
    },
    next() {
      console.log("ad next");
    },
  };

  var storage$1 = utils$h.getStorage(time$1.str("YYYY-MM-DD") + "百度极速");
  common$e.toTask = toTask$1;
  common$e.inHome = inHome$1;
  common$e.pointMap = pointMap$1;
  common$e.swipeUp = swipeUp$1;
  common$e.swipeDown = swipeDown$1;
  common$e.readArticle = readArticle$1;
  common$e.ad = ad$1;
  common$e.storage = storage$1;

  var utils$g = utils_1;
  var ocrGml$d = ocrGml_1;
  var common$d = common$e;
  var ACTION$4 = action;
  var aRead$3 = new ACTION$4("阅读", {
    interval: null, //每个多少秒执行一次
    canStartHour: null, //最早可以开始的时间
    canStartHourEnd: null, //最晚可以开始的时间
    lastStartTime: null, //上一次的开始时间
    lastEndTime: null, //上一次的结束时间
    execSCount: 0, //执行成功次数
    execFCount: 0, //执行失败次数
    maxExecSCount: null, //最大成功执行次数
    maxExecFCount: null, //最大失败执行次数
    maxTotalExecCount: null, //最大总执行次数
    storage: common$d.storage,
  });
  aRead$3.startRead = function () {
    var content = ["小时前", "天前", "周前", "前天", "月前"];
    var ocrItem = ocrGml$d.findTextOne(
      content,
      true,
      null,
      5,
      (device.height / 10) * 2
    );
    if (ocrItem) {
      console.log("找到-" + ocrItem.text + "-");
      utils$g.clickOcrItem(ocrItem);
      sleep(utils$g.getRandom(3, 5, 1000));
      var ocrItem = ocrGml$d.captureExistOne(["全屏"], true);
      if (ocrItem) {
        var baseSpan = 10;
        var span = utils$g.getRandom(baseSpan, baseSpan + 30);
        console.log("开始看视频-" + span + "-s");
        sleep(span * 1000);
        back();
        sleep(utils$g.getRandom(2, 4, 1000));
        return;
      }
      var baseSpan = 40;
      var span = utils$g.getRandom(baseSpan, baseSpan + 5);
      console.log("开始看文章-" + span + "-s");
      common$d.readArticle(span, 5);
      back();
      sleep(utils$g.getRandom(2, 4, 1000));
      return;
    }
  };

  aRead$3.exec = function () {
    this.startRead();
  };

  var aRead_1 = aRead$3;

  var ocrGml$c = ocrGml_1;
  var utils$f = utils_1;
  var common$c = common$e;
  function ifInTaskDefault$1() {
    var ocrItem = ocrGml$c.captureExistOne(["金币收益", "现金收益", "去提现"]);
    return ocrItem;
  }
  var inTask$c = {
    run(ifInTask, config) {
      this.ifInTask = ifInTask || ifInTaskDefault$1;
      this.wx();
      this.sign();
      if (this.over()) {
        return;
      }
      this.ad();
      if (config && config.fromAward) ; else {
        this.award();
      }
    },
    //点击领取
    award() {
      var contents = ["可领"];
      var ocrItem = ocrGml$c.captureExistOne(contents, true);
      if (ocrItem) {
        utils$f.clickOcrItem(ocrItem);
        sleep(utils$f.getRandom(2, 3, 1000));
        this.run(null, {
          fromAward: true,
        });
      }
    },
    wx() {
      var content = "微信提现";
      var UIText = utils$f.existsTextStartsWith(content);
      if (UIText) {
        utils$f.clickPointMap(common$c.pointMap["微信提现关闭"]);
        return true;
      }
    },
    over() {
      var contents = ["开心收下", "立即收下"];
      var ocrItem = ocrGml$c.captureExistOne(contents, true);
      if (ocrItem) {
        utils$f.clickOcrItem(ocrItem);
        sleep(utils$f.getRandom(2, 3, 1000));
        return true;
      }
    },
    sign() {
      var contents = ["直接领取", "我知道了"];
      var ocrItem = ocrGml$c.captureExistOne(contents, true);
      if (ocrItem) {
        utils$f.clickOcrItem(ocrItem);
        sleep(utils$f.getRandom(2, 3, 1000));
        this.run();
      }
    },
    ad() {
      var contents = ["看广告再", "看广告得", "看视频再", "看广告领", "看视频领"];
      var ocrItem = ocrGml$c.captureExistOne(contents, true);
      if (ocrItem) {
        utils$f.clickOcrItem(ocrItem);
        sleep(utils$f.getRandom(2, 3, 1000));
        common$c.ad.init(2, this.ifInTask);
        sleep(utils$f.getRandom(2, 3, 1000));
        this.run();
      }
    },
  };

  var inTask_1$1 = inTask$c;

  var utils$e = utils_1;
  var ocrGml$b = ocrGml_1;
  var ACTION$3 = action;
  var common$b = common$e;
  var aBless$1 = new ACTION$3("开福袋");
  var inTask$b = inTask_1$1;
  aBless$1.goStart = function () {
    if (common$b.inHome()) {
      sleep(utils$e.getRandom(1.5, 2, 1000));
      utils$e.clickPointMap(common$b.pointMap["首页我的"]);
      sleep(utils$e.getRandom(2, 4, 1000));
      utils$e.clickTextStartsWith("邀请好友");
      sleep(utils$e.getRandom(2, 4, 1000));
      return true;
    }
  };
  aBless$1.share5 = function () {
    var content = "必得199金币";
    var UIText = utils$e.existsTextEndsWith(content);
    if (UIText) {
      aBless$1.share5Exec();
      return;
    }
    console.log("share5", "没找到-必得199金币-");
  };
  aBless$1.share5Exec = function () {
    var content = "必得199金币";
    for (var index = 0; index < 5; index++) {
      var UIText = utils$e.existsTextEndsWith(content);
      if (UIText) {
        utils$e.clickUIText(UIText);
        sleep(utils$e.getRandom(2, 3, 1000));
        utils$e.clickTextStartsWith("去粘贴");
        sleep(utils$e.getRandom(5, 7, 1000));
        back();
        sleep(utils$e.getRandom(5, 7, 1000));
        if (utils$e.existsText("继续分享")) {
          console.log("找到-继续分享-");
          utils$e.clickText("继续分享");
          sleep(utils$e.getRandom(2, 4, 1000));
        } else if (utils$e.existsText("开心收下")) {
          console.log("找到-开心收下-");
          utils$e.clickText("开心收下");
        }
      }
    }
  };
  aBless$1.goBack = function () {
    back();
    sleep(utils$e.getRandom(3, 4, 1000));
    var ocrItem = ocrGml$b.captureExistOne("放弃奖励");
    if (ocrItem) {
      back();
      sleep(utils$e.getRandom(2, 4, 1000));
    }
  };
  aBless$1.exec = function () {
    this.share5();
    sleep(utils$e.getRandom(1.5, 2, 1000));
    var UIText = utils$e.clickText("开福袋");
    if (UIText) {
      console.log("找到【开福袋】");
      sleep(utils$e.getRandom(1.5, 2, 1000));
      inTask$b.run(function () {
        var ocrItem = ocrGml$b.captureExistOne(["面对面", "邀好友"]);
        return ocrItem;
      });
      this.goBack();
      return;
    }
    console.log("没找到【开福袋】");
    this.goBack();
  };

  var aBless_1 = aBless$1;

  var utils$d = utils_1;
  var ocrGml$a = ocrGml_1;
  var ACTION$2 = action;
  var inTask$a = inTask_1$1;
  var aTreasure$3 = new ACTION$2("开宝箱");
  aTreasure$3.exec = function () {
    var contents = ["开宝箱得"];
    var ocrItem = ocrGml$a.captureExistOne(contents, true);
    if (ocrItem) {
      utils$d.clickOcrItem(ocrItem);
      sleep(utils$d.getRandom(2.5, 3, 1000));
      inTask$a.run();
      return;
    }
    var content = /领\d{1,4}金币/;
    var UIText = utils$d.existsTextMatches(content);
    if (UIText) {
      utils$d.clickUIText(UIText);
      sleep(utils$d.getRandom(2.5, 3, 1000));
      inTask$a.run();
      return;
    }
  };

  var aTreasure_1 = aTreasure$3;

  var App$1 = app$1;
  var utils$c = utils_1;
  var common$a = common$e;
  var baiDuJiSu = new App$1("百度极速版", {
    interval: 10,
  });
  var aRead$2 = aRead_1;
  var aBless = aBless_1;
  var aTreasure$2 = aTreasure_1;
  var inTask$9 = inTask_1$1;
  baiDuJiSu.run = function () {
    aRead$2.flow();

    if (common$a.inHome()) {
      sleep(utils$c.getRandom(1.5, 2, 1000));
      common$a.toTask();
      sleep(utils$c.getRandom(5, 12, 1000));
      inTask$9.run();
      aTreasure$2.flow();
    }
    sleep(utils$c.getRandom(2, 3, 1000));
    aBless.flow();
  };

  var common$9 = {};

  var utils$b = utils_1;
  var time = time_1;
  var ocrGml$9 = ocrGml_1;
  var readArticle = readArticle_1;
  var swipeUp = swipeUp_1;
  var swipeDown = swipeDown_1;
  var pointMap = {
    首页任务: {
      points: [
        // prettier-ignore
        656, 2136, 858, 2296,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
    首页我的: {
      points: [
        // prettier-ignore
        858, 2136, 1061, 2296,
      ],
      size: {
        x: 1080,
        y: 2340,
      },
    },
  };
  function inHome() {
    // prettier-ignore
    var contents = [
            "百度",
            "听书"
        ];
    var result = ocrGml$9.captureExistAll(contents);
    if (result) {
      console.log("找到-" + contents.join("和") + "-,判断在首页");
    } else {
      console.log("没找到-" + contents.join("和") + "-");
    }
    return result;
  }
  function toTask() {
    console.log("前往-首页任务-");
    utils$b.clickPointMap(pointMap["首页任务"]);
  }

  function ifHasNextAdDefault() {
    var contents = [
      //prettier-ignore
      "看视频领",
      "看视频再领",
      "看视频再得",
      "看广告领",
      "看广告再领",
      "看广告再得",
      "再看一个",
      "再看1个",
    ];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      var UIText = utils$b.existsTextStartsWith(content);
      if (UIText) {
        console.log("找到-" + content + "-", ",存在下一个广告可看");
        return {
          result: true,
          trigger: function () {
            utils$b.clickUIText(UIText);
          },
        };
      }
    }
    return {
      result: false,
      trigger: function () {},
    };
  }
  function ifAdOverDefault() {
    var UIText = utils$b.existsTextStartsWith("领取成功");
    if (UIText) {
      console.log("找到-领取成功-");
      return UIText;
    }
    var UIText = utils$b.existsTextStartsWith("已领取");
    if (UIText) {
      console.log("找到-已领取-");
      return UIText;
    }
    var UIText = utils$b.existsTextStartsWith("已完成任务 ");
    if (UIText) {
      console.log("找到-已完成任务 -");
      return UIText;
    }
  }
  function existAdDefault() {
    var contents = [
      //prettier-ignore
      "残忍离开",
      "坚持离开",
      "残忍退出",
      "坚持退出",
    ];
    for (var index = 0; index < contents.length; index++) {
      var content = contents[index];
      var UIText = utils$b.existsTextStartsWith(content);
      if (UIText) {
        console.log("找到-" + content + "-，", "关闭广告");
        utils$b.clickUIText(UIText);
      }
    }
  }

  var AD_CONST_MIN_INTERVAL = 40;
  var AD_CONST_MAX_GO_BACK_TIMES = 4;

  var ad = {
    inStart: false,
    inHome: false,
    ifHasNextAd: null, //判断是否有下一个广告
    ifAdOver: null, //判断广告实际是否比预计时间提前结束
    ifInStart: null, //判断是否是在任务页
    ifInHome: null, //判断是否在首页
    hasWatchTimes: 0,
    maxTimes: 0,
    init(maxTimes, ifInStart, ifHasNextAd, ifAdOver, exitAd, ifInHome) {
      this.hasWatchTimes = 0;
      this.maxTimes = utils$b.getRandom(maxTimes, maxTimes + 2);
      this.ifInStart = ifInStart;
      this.ifHasNextAd = ifHasNextAd || ifHasNextAdDefault;
      this.ifAdOver = ifAdOver || ifAdOverDefault;
      this.exitAd = exitAd || existAdDefault;
      this.ifInHome = ifInHome || inHome;
      console.log("ad init: 本轮最多看-" + this.maxTimes + "-个广告");
      this.run();
    },
    run() {
      //开始看广告
      var adSpan = AD_CONST_MIN_INTERVAL + utils$b.getRandom(0, 5);
      console.log(
        //prettier-ignore
        "ad run: 开始看-" + (this.hasWatchTimes+1) + "-个广告，预计时间-" + adSpan + "-s"
      );
      var checkAdOverSpan = 2; //每隔2s检查当前广告是否已经结束
      var isOverEarly = false;
      var hasWatchSpan = 0;
      var count = 0;
      while (adSpan > checkAdOverSpan) {
        if (hasWatchSpan > 30) {
          if (!utils$b.existsTextStartsWith("广告")) {
            console.log(
              //prettier-ignore
              "ad run: 已过-" + hasWatchSpan + "-s但是没找到-广告-,即将执行一次back()"
            );
            back();
            sleep(utils$b.getRandom(2, 2.5, 1000));
          }
        }
        if (this.ifAdOver && this.ifAdOver()) {
          var waitSpan = utils$b.getRandom(2, 3.5);
          console.log("ad run: 广告已结束,再过" + waitSpan + "s后停止当前广告");
          sleep(waitSpan * 1000);
          isOverEarly = true; //广告实际比预计的时间提前结束
          break;
        }
        sleep(checkAdOverSpan * 1000);
        adSpan = adSpan - checkAdOverSpan;
        hasWatchSpan = hasWatchSpan + checkAdOverSpan;
        count = count + 1;
        if (count % 5 == 0) {
          console.log("ad run: 广告时间预计还剩-" + adSpan + "-s");
        }
      }
      this.hasWatchTimes = this.hasWatchTimes + 1;
      if (isOverEarly) {
        this.goBack();
        return;
      }
      if (adSpan > 0) {
        console.log("ad run: 广告时间还剩最后的" + adSpan + "秒");
        sleep(adSpan * 1000);
        this.goBack();
        return;
      }
    },
    goBack() {
      var index = 0;
      while (index < AD_CONST_MAX_GO_BACK_TIMES) {
        console.log("ad goBack: 第" + (index + 1) + "次执行back");
        back();
        sleep(utils$b.getRandom(2.5, 4, 1000));
        var hasNextAd = this.ifHasNextAd();
        if (hasNextAd.result) {
          if (this.hasWatchTimes >= this.maxTimes) {
            console.log(
              //prettier-ignore
              "当前看广告-" + this.hasWatchTimes + "-次，最多看-" + this.maxTimes + "-次，执行exitAd"
            );
            this.exitAd();
            return;
          } else {
            console.log("开始看下一个广告");
            hasNextAd.trigger();
            sleep(utils$b.getRandom(2, 3, 1000));
            this.run();
            return;
          }
        }
        if (this.ifInStart && this.ifInStart()) {
          console.log("ad goBack: 判断在开始页");
          this.inStart = true;
          this.after();
          return;
        }
        if (this.ifInHome && this.ifInHome()) {
          console.log("ad goBack: 判断在app首页");
          this.inHome = true;
          this.after();
          return;
        }
        index = index + 1;
      }
      this.after();
    },
    after() {
      console.log("ad after");
      this.next();
    },
    next() {
      console.log("ad next");
    },
  };

  var storage = utils$b.getStorage(time.str("YYYY-MM-DD") + "百度畅听");
  common$9.toTask = toTask;
  common$9.inHome = inHome;
  common$9.pointMap = pointMap;
  common$9.swipeUp = swipeUp;
  common$9.swipeDown = swipeDown;
  common$9.readArticle = readArticle;
  common$9.ad = ad;
  common$9.storage = storage;

  var ocrGml$8 = ocrGml_1;
  var utils$a = utils_1;
  var common$8 = common$9;
  function ifInTaskDefault() {
    var ocrItem = ocrGml$8.captureExistOne(["金币收益", "现金收益", "去提现"]);
    return ocrItem;
  }
  var inTask$8 = {
    run(ifInTask, config) {
      this.ifInTask = ifInTask || ifInTaskDefault;
      this.over();
      sleep(utils$a.getRandom(1, 1.5, 1000));
      this.sign();
      sleep(utils$a.getRandom(1, 1.5, 1000));
      if (this.ad()) {
        return;
      }
      sleep(utils$a.getRandom(1, 1.5, 1000));
      if (config && config.fromAward) ; else {
        this.award();
      }
    },
    //领取
    award() {
      var contents = ["领取"];
      var ocrItem = ocrGml$8.captureExistOne(contents, true);
      if (ocrItem) {
        utils$a.clickOcrItem(ocrItem);
        this.run(null, {
          fromAward: true,
        });
      }
    },
    over() {
      var contents = ["开心收下", "立即收下", "我知道了"];
      var ocrItem = ocrGml$8.captureExistOne(contents, true);
      if (ocrItem) {
        utils$a.clickOcrItem(ocrItem);
        sleep(utils$a.getRandom(2, 3, 1000));
        return;
      }
    },
    sign() {
      var contents = ["立即签到"];
      var ocrItem = ocrGml$8.captureExistOne(contents, true);
      if (ocrItem) {
        utils$a.clickOcrItem(ocrItem);
        sleep(utils$a.getRandom(2, 3, 1000));
      }
      var contents = ["直接领取"];
      var ocrItem = ocrGml$8.captureExistOne(contents, true);
      if (ocrItem) {
        utils$a.clickOcrItem(ocrItem);
        sleep(utils$a.getRandom(2, 3, 1000));
      }
      return;
    },
    ad() {
      var contents = ["看广告再", "看视频再", "看广告领", "看视频领"];
      var ocrItem = ocrGml$8.captureExistOne(contents, true);
      if (ocrItem) {
        utils$a.clickOcrItem(ocrItem);
        sleep(utils$a.getRandom(2, 3, 1000));
        common$8.ad.init(2, this.ifInTask);
        sleep(utils$a.getRandom(2, 3, 1000));
        this.run(null, {
          fromAd: true,
        });
        return true;
      }
    },
  };

  var inTask_1 = inTask$8;

  var utils$9 = utils_1;
  var ocrGml$7 = ocrGml_1;
  var common$7 = common$9;
  var inTask$7 = inTask_1;
  var Action$5 = action;
  var actionOneAcc = new Action$5("一键给手机加速", {
    execSCount: 0,
    execFCount: 0,
    maxExecSCount: 1, //最大成功执行次数
    maxExecFCount: 2, //最大失败执行次数
    maxTotalExecCount: 3, //最大总执行次数
    storage: common$7.storage,
  });
  actionOneAcc.exec = function () {
    var content = "一键给手机加速";
    var ocrItem = ocrGml$7.findTextOne(
      content,
      true,
      null,
      12,
      (device.height / 10) * 2
    );
    if (ocrItem) {
      utils$9.clickOcrItem(ocrItem);
      sleep(utils$9.getRandom(6, 8, 1000));
      back();
      sleep(utils$9.getRandom(2, 3, 1000));
      inTask$7.run();
      this.execSCount++;
      this.updateStorage();
    } else {
      this.execFCount++;
      this.updateStorage();
      console.log("没有找到" + content);
    }
  };
  var aOneAcc$1 = actionOneAcc;

  var utils$8 = utils_1;
  var ocrGml$6 = ocrGml_1;
  var inTask$6 = inTask_1;
  var common$6 = common$9;
  var Action$4 = action;
  var actionOneAdd1 = new Action$4("添加活动到桌面", {
    execSCount: 0,
    execFCount: 0,
    maxExecSCount: 1, //最大成功执行次数
    maxExecFCount: 2, //最大失败执行次数
    maxTotalExecCount: 3, //最大总执行次数
    storage: common$6.storage,
  });
  actionOneAdd1.exec = function () {
    var content = "添加活动到桌面";
    var ocrItem = ocrGml$6.findTextOne(
      content,
      true,
      null,
      10,
      (device.height / 10) * 2
    );
    if (ocrItem) {
      utils$8.clickOcrItem(ocrItem);
      sleep(utils$8.getRandom(5, 8, 1000));
      inTask$6.run();
      this.execSCount++;
      this.updateStorage();
    } else {
      this.execFCount++;
      this.updateStorage();
      console.log("没有找到" + content);
    }
  };
  var aOneAdd1$1 = actionOneAdd1;

  var utils$7 = utils_1;
  var ocrGml$5 = ocrGml_1;
  var inTask$5 = inTask_1;
  var common$5 = common$9;
  var Action$3 = action;
  var actionOneAdd2 = new Action$3("添加加速工具", {
    execSCount: 0,
    execFCount: 0,
    maxExecSCount: 1, //最大成功执行次数
    maxExecFCount: 2, //最大失败执行次数
    maxTotalExecCount: 3, //最大总执行次数
    storage: common$5.storage,
  });
  actionOneAdd2.exec = function () {
    var content = "添加加速工具";
    var ocrItem = ocrGml$5.findTextOne(
      content,
      true,
      null,
      10,
      (device.height / 10) * 2
    );
    if (ocrItem) {
      utils$7.clickOcrItem(ocrItem);
      sleep(utils$7.getRandom(5, 8, 1000));
      var content = "好的";
      var ocrItem = ocrGml$5.captureExistOne(content, true);
      if (ocrItem) {
        utils$7.clickOcrItem(ocrItem);
        sleep(utils$7.getRandom(2, 3, 1000));
        back();
        sleep(utils$7.getRandom(2, 3, 1000));
        inTask$5.run();
        this.execSCount++;
        this.updateStorage();
        return;
      }
      this.execFCount++;
      this.updateStorage();
      console.log("没有找到" + content);
    } else {
      this.execFCount++;
      this.updateStorage();
      console.log("没有找到" + content);
    }
  };
  var aOneAdd2$1 = actionOneAdd2;

  var utils$6 = utils_1;
  var appUtils$1 = app_1;
  var ocrGml$4 = ocrGml_1;
  var inTask$4 = inTask_1;
  var common$4 = common$9;
  var Action$2 = action;
  var actionOpen1 = new Action$2("打开淘宝", {
    execSCount: 0,
    execFCount: 0,
    maxExecSCount: 1, //最大成功执行次数
    maxExecFCount: 2, //最大失败执行次数
    maxTotalExecCount: 3, //最大总执行次数
    storage: common$4.storage,
  });
  actionOpen1.exec = function () {
    var content = "去淘宝";
    var ocrItem = ocrGml$4.findTextOne(
      content,
      true,
      null,
      20,
      (device.height / 10) * 4
    );
    if (ocrItem) {
      utils$6.clickOcrItem(ocrItem);
      sleep(utils$6.getRandom(5, 8, 1000));
      if (appUtils$1.ifInstalled("淘宝")) {
        sleep(utils$6.getRandom(3, 5, 1000));
        appUtils$1.openApp("百度畅听版");
        sleep(utils$6.getRandom(2, 3, 1000));
      } else {
        sleep(utils$6.getRandom(3, 5, 1000));
        back();
      }
      inTask$4.run();
      this.execSCount++;
      this.updateStorage();
    } else {
      this.execFCount++;
      this.updateStorage();
      console.log("没有找到" + content);
    }
  };
  var aOpen1$1 = actionOpen1;

  var utils$5 = utils_1;
  var appUtils = app_1;
  var ocrGml$3 = ocrGml_1;
  var inTask$3 = inTask_1;
  var common$3 = common$9;
  var Action$1 = action;
  var actionOpen2 = new Action$1("打开支付宝", {
    execSCount: 0,
    execFCount: 0,
    maxExecSCount: 1, //最大成功执行次数
    maxExecFCount: 2, //最大失败执行次数
    maxTotalExecCount: 3, //最大总执行次数
    storage: common$3.storage,
  });
  actionOpen2.exec = function () {
    var content = "去支付宝";
    var ocrItem = ocrGml$3.findTextOne(
      content,
      true,
      null,
      20,
      (device.height / 10) * 4
    );
    if (ocrItem) {
      utils$5.clickOcrItem(ocrItem);
      sleep(utils$5.getRandom(5, 8, 1000));
      if (appUtils.ifInstalled("支付宝")) {
        sleep(utils$5.getRandom(3, 5, 1000));
        appUtils.openApp("百度畅听版");
        sleep(utils$5.getRandom(2, 3, 1000));
      } else {
        sleep(utils$5.getRandom(3, 5, 1000));
        back();
      }
      inTask$3.run();
      this.execSCount++;
      this.updateStorage();
    } else {
      this.execFCount++;
      this.updateStorage();
      console.log("没有找到" + content);
    }
  };
  var aOpen2$1 = actionOpen2;

  var ACTION$1 = action;
  var utils$4 = utils_1;
  var ocrGml$2 = ocrGml_1;
  var common$2 = common$9;
  var actionRead = new ACTION$1("阅读");
  actionRead.startRead = function () {
    var content = ["听文章"];
    var ocrItem = ocrGml$2.findTextOne(
      content,
      true,
      null,
      5,
      (device.height / 10) * 2
    );
    if (ocrItem) {
      utils$4.clickOcrItem(ocrItem);
      sleep(utils$4.getRandom(3, 5, 1000));
      var baseSpan = 40;
      var span = utils$4.getRandom(baseSpan, baseSpan + 5);
      console.log("开始看文章-" + span + "-s");
      common$2.readArticle(span, 5);
      back();
      sleep(utils$4.getRandom(2, 4, 1000));
      return;
    }
  };

  actionRead.exec = function () {
    this.startRead();
  };

  var aRead$1 = actionRead;

  var utils$3 = utils_1;
  var ocrGml$1 = ocrGml_1;
  var common$1 = common$9;
  var inTask$2 = inTask_1;
  var Action = action;
  var actionSearch5 = new Action("search5", {
    execSCount: 0,
    execFCount: 0,
    maxExecSCount: 5,
    maxExecFCount: 5,
    storage: common$1.storage,
  });
  actionSearch5.exec = function () {
    var content = "随机搜得金币";
    var ocrItem = ocrGml$1.findTextOne(
      content,
      true,
      null,
      6,
      (device.height / 10) * 2
    );
    if (ocrItem) {
      var point = utils$3.getOcrItemPoint(ocrItem);
      var x = point.x;
      var y = point.y;
      for (var index = 0; index < 1; index++) {
        utils$3.clickXY(x, y);
        sleep(utils$3.getRandom(3, 5, 1000));
        utils$3.swipe(1 / 2, 1 / 2, 1 / 4, 1 / 3);
        sleep(utils$3.getRandom(3, 4, 1000));
        back();
        if (utils$3.clickTextStartsWith("残忍离开")) {
          console.log("actionSearch5", "找到-残忍离开-");
          sleep(utils$3.getRandom(2, 3, 1000));
        } else {
          console.log("actionSearch5", "没找到-残忍离开-");
        }
        inTask$2.run();
      }
      this.execSCount++;
      this.updateStorage();
    } else {
      this.execFCount++;
      this.updateStorage();
      console.log("没有找到" + content);
    }
  };
  var aSearch5$1 = actionSearch5;

  var utils$2 = utils_1;
  var ocrGml = ocrGml_1;
  var ACTION = action;
  var actionTreasure = new ACTION("开宝箱");
  var inTask$1 = inTask_1;
  actionTreasure.exec = function () {
    inTask$1.run();
    var contents = ["开宝箱得金币"];
    var ocrItem = ocrGml.captureExistOne(contents, true);
    if (ocrItem) {
      utils$2.clickOcrItem(ocrItem);
      sleep(utils$2.getRandom(2.5, 3, 1000));
      inTask$1.run();
      return;
    }
  };

  var aTreasure$1 = actionTreasure;

  var App = app$1;
  var utils$1 = utils_1;
  var common = common$9;
  var inTask = inTask_1;
  var baiDuChangTing = new App("百度畅听版", {
    interval: 10,
    testOpenCount: 3,
    storage: common.storage,
  });
  var aOneAcc = aOneAcc$1;
  var aOneAdd1 = aOneAdd1$1;
  var aOneAdd2 = aOneAdd2$1;
  var aOpen1 = aOpen1$1;
  var aOpen2 = aOpen2$1;
  var aRead = aRead$1;
  var aSearch5 = aSearch5$1;
  var aTreasure = aTreasure$1;
  baiDuChangTing.runTest = function () {
    common.toTask();
    sleep(utils$1.getRandom(3, 7, 1000));
  };
  baiDuChangTing.as = [
    aSearch5,
    aOneAcc,
    aOneAdd1,
    aOneAdd2,
    aOpen1,
    aOpen2,
  ];
  baiDuChangTing.run = function () {
    aRead.flow();
    if (common.inHome()) {
      sleep(utils$1.getRandom(1.5, 2, 1000));
      common.toTask();
      sleep(utils$1.getRandom(5, 8, 1000));
      inTask.run();
      var nextAction = this.getNextAction();
      if (nextAction) {
        nextAction.flow();
      }
      aTreasure.flow();
    }
  };

  var config$1 = {
    mobile: "18762750392",
    ip: "http://47.120.74.135",
    port: "3000",
    ignoreApps: [
      //prettier-ignore
    ],
  };

  var utils = utils_1;
  var baoShuang = baoShuang_1;
  var woAiZhuiJu = woAiZhuiJu_1;
  var config = config$1;
  auto.waitFor();

  var apps = [
    //prettier-ignore
    baoShuang,
    woAiZhuiJu,
    // xiGua,
    // touTiao,
    // shanDianSouSuo,
    // youShi,
    // kuaiShouJiSu,
    // baiDuJiSu,
    // baiDuChangTing,
  ];

  function loop() {
    while (true) {
      for (var index = 0; index < apps.length; index++) {
        var app = apps[index];
        if (config.ignoreApps.indexOf(app.name) > -1) {
          continue;
        }
        if (!app.checkInstalled()) {
          continue;
        }
        if (!app.isOver) {
          app.main();
          var baseWait = 5;
          sleep(utils.getRandom(baseWait, baseWait + 3, 1000));
        }
      }
    }
  }
  loop();

  return startAppTest;

})();
